Annotation of embedaddon/php/ext/spl/tests/iterator_030.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: EmptyIterator access
! 3: --FILE--
! 4: <?php
! 5:
! 6: $it = new EmptyIterator;
! 7:
! 8: var_dump($it->valid());
! 9: $it->rewind();
! 10: var_dump($it->valid());
! 11: $it->next();
! 12: var_dump($it->valid());
! 13:
! 14: try
! 15: {
! 16: var_dump($it->key());
! 17: }
! 18: catch(BadMethodCallException $e)
! 19: {
! 20: echo $e->getMessage() . "\n";
! 21: }
! 22:
! 23: try
! 24: {
! 25: var_dump($it->current());
! 26: }
! 27: catch(BadMethodCallException $e)
! 28: {
! 29: echo $e->getMessage() . "\n";
! 30: }
! 31:
! 32: var_dump($it->valid());
! 33:
! 34: ?>
! 35: ===DONE===
! 36: <?php exit(0); ?>
! 37: --EXPECT--
! 38: bool(false)
! 39: bool(false)
! 40: bool(false)
! 41: Accessing the key of an EmptyIterator
! 42: Accessing the value of an EmptyIterator
! 43: bool(false)
! 44: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>