diff options
Diffstat (limited to 'ext/spl/tests/spl_iterator_iterator_constructor.phpt')
-rw-r--r-- | ext/spl/tests/spl_iterator_iterator_constructor.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_iterator_iterator_constructor.phpt b/ext/spl/tests/spl_iterator_iterator_constructor.phpt new file mode 100644 index 0000000..d4fdb14 --- /dev/null +++ b/ext/spl/tests/spl_iterator_iterator_constructor.phpt @@ -0,0 +1,30 @@ +--TEST-- +SPL: IteratorInterator constructor checks +--CREDITS-- +Sean Burlington www.practicalweb.co.uk +TestFest London May 2009 +--FILE-- +<?php + + //I think this is testing line 1297 of spl_iterators.c + + $array = array(array(7,8,9),1,2,3,array(4,5,6)); +$arrayIterator = new ArrayIterator($array); +try { +$test = new IteratorIterator($arrayIterator); + +$test = new IteratorIterator($arrayIterator, 1); +$test = new IteratorIterator($arrayIterator, 1, 1); +$test = new IteratorIterator($arrayIterator, 1, 1, 1); +$test = new IteratorIterator($arrayIterator, 1, 1, 1, 1); + +} catch (InvalidArgumentException $e){ + print $e->getMessage() . "\n"; +} + + +?> +===DONE=== +--EXPECTF-- +IteratorIterator::__construct() expects at most 2 parameters, 3 given +===DONE=== |