diff options
Diffstat (limited to 'ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt')
-rw-r--r-- | ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt index cbf8136ab6..0e3c1c1439 100644 --- a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt +++ b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt @@ -1,36 +1,36 @@ ---TEST--
-SPL: RecursiveIteratorIterator - Exception thrown in callHasChildren which should be handled in next()
---FILE--
-<?php
-
-$arr = array(1,2);
-$arrOb = new ArrayObject($arr);
-
-$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
-
-class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
-
- function callHasChildren() {
- throw new Exception;
- }
-}
-
-
-$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD);
-
-var_dump($recItIt->next());
-
-$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY);
-
-var_dump($recItIt2->next());
-
-?>
---EXPECTF--
-NULL
-
-Fatal error: Uncaught Exception in %s
-Stack trace:
-#0 [internal function]: MyRecursiveIteratorIterator->callHasChildren()
-#1 %s: RecursiveIteratorIterator->next()
-#2 {main}
- thrown in %s on line %d
+--TEST-- +SPL: RecursiveIteratorIterator - Exception thrown in callHasChildren which should be handled in next() +--FILE-- +<?php + +$arr = array(1,2); +$arrOb = new ArrayObject($arr); + +$recArrIt = new RecursiveArrayIterator($arrOb->getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function callHasChildren() { + throw new Exception; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); + +var_dump($recItIt->next()); + +$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); + +var_dump($recItIt2->next()); + +?> +--EXPECTF-- +NULL + +Fatal error: Uncaught Exception in %s +Stack trace: +#0 [internal function]: MyRecursiveIteratorIterator->callHasChildren() +#1 %s: RecursiveIteratorIterator->next() +#2 {main} + thrown in %s on line %d |