Annotation of embedaddon/php/ext/spl/tests/recursive_tree_iterator_setprefixpart.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: RecursiveTreeIterator::setPrefixPart() Test arguments
3: --CREDITS--
4: Roshan Abraham (roshanabrahams@gmail.com)
5: TestFest London May 2009
6: --FILE--
7: <?php
8:
9: $arr = array(
10: "a" => array("b")
11: );
12:
13: $it = new RecursiveArrayIterator($arr);
14: $it = new RecursiveTreeIterator($it);
15:
16: $it->setPrefixPart(1); // Should throw a warning as setPrefixPart expects 2 arguments
17:
18: $a = new stdClass();
19: $it->setPrefixPart($a, 1); // Should throw a warning as setPrefixPart expects argument 1 to be long integer
20:
21: $it->setPrefixPart(1, $a); // Should throw a warning as setPrefixPart expects argument 2 to be a string
22:
23:
24: ?>
25: ===DONE===
26: --EXPECTF--
27: Warning: RecursiveTreeIterator::setPrefixPart() expects exactly 2 parameters, 1 given in %s on line %d
28:
29: Warning: RecursiveTreeIterator::setPrefixPart() expects parameter 1 to be long, object given in %s on line %d
30:
31: Warning: RecursiveTreeIterator::setPrefixPart() expects parameter 2 to be %binary_string_optional%, object given in %s on line %d
32: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>