From b9630ddf52bc802abcd82dc3ebee9d338b1a6077 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Fri, 3 Mar 2006 22:56:27 +0000 Subject: [PATCH] - Fix issue with LimitIterator --- ext/spl/tests/iterator_032.phpt | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 ext/spl/tests/iterator_032.phpt diff --git a/ext/spl/tests/iterator_032.phpt b/ext/spl/tests/iterator_032.phpt new file mode 100755 index 0000000000..7d15456155 --- /dev/null +++ b/ext/spl/tests/iterator_032.phpt @@ -0,0 +1,48 @@ +--TEST-- +SPL: LimitIterator::getPosition() +--SKIPIF-- + +--FILE-- +$v) +{ + echo "$k=>$v\n"; + var_dump($it->getPosition()); +} + +try +{ + $it->seek(0); +} +catch(OutOfBoundsException $e) +{ + echo $e->getMessage() . "\n"; +} + +$it->seek(2); +var_dump($it->current()); + +try +{ + $it->seek(3); +} +catch(OutOfBoundsException $e) +{ + echo $e->getMessage() . "\n"; +} + +?> +===DONE=== + +--EXPECT-- +1=>2 +int(1) +2=>3 +int(2) +Cannot seek to 0 which is below the offset 1 +int(3) +Cannot seek to 3 which is behind offest 1 plus count 2 +===DONE=== -- 2.50.1