Annotation of embedaddon/php/ext/spl/tests/recursive_tree_iterator_007.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: RecursiveTreeIterator and Exception from getEntry()
3: --INI--
4: error_reporting=E_ALL&~E_NOTICE
5: --FILE--
6: <?php
7:
8: $ary = array(new stdClass);
9:
10: class RecursiveArrayIteratorAggregated implements IteratorAggregate {
11: public $it;
12: function __construct($it) {
13: $this->it = new RecursiveArrayIterator($it);
14: }
15: function getIterator() {
16: return $this->it;
17: }
18: }
19:
20: $it = new RecursiveArrayIteratorAggregated($ary);
21: try {
22: foreach(new RecursiveTreeIterator($it) as $k => $v) {
23: echo "[$k] => $v\n";
24: }
25: } catch (UnexpectedValueException $e) {
26: echo "UnexpectedValueException thrown\n";
27: }
28:
29: ?>
30: ===DONE===
31: --EXPECTF--
32: UnexpectedValueException thrown
33: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>