Annotation of embedaddon/php/ext/spl/tests/spl_limit_iterator_check_limits.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: SPL: LimitIterator check limits are valid
3: --CREDITS--
4: Sean Burlington www.practicalweb.co.uk
5: TestFest London May 2009
6: --FILE--
7: <?php
8: $array = array(array(7,8,9),1,2,3,array(4,5,6));
9: $arrayIterator = new ArrayIterator($array);
10:
11: try {
12: $limitIterator = new LimitIterator($arrayIterator, -1);
13: } catch (OutOfRangeException $e){
14: print $e->getMessage(). "\n";
15: }
16:
17:
18: try {
19: $limitIterator = new LimitIterator($arrayIterator, 0, -2);
20: } catch (OutOfRangeException $e){
21: print $e->getMessage() . "\n";
22: }
23:
24: try {
25: $limitIterator = new LimitIterator($arrayIterator, 0, -1);
26: } catch (OutOfRangeException $e){
27: print $e->getMessage() . "\n";
28: }
29:
30:
31:
32: ?>
33: ===DONE===
34: --EXPECTF--
35: Parameter offset must be >= 0
36: Parameter count must either be -1 or a value greater than or equal 0
37: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>