Annotation of embedaddon/php/ext/spl/tests/iterator_020.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: AppendIterator
! 3: --FILE--
! 4: <?php
! 5:
! 6: echo "===Empty===\n";
! 7:
! 8: $it = new AppendIterator;
! 9:
! 10: foreach($it as $key=>$val)
! 11: {
! 12: echo "$key=>$val\n";
! 13: }
! 14:
! 15: echo "===Append===\n";
! 16:
! 17: $it->append(new ArrayIterator(array(0 => 'A', 1 => 'B')));
! 18:
! 19: foreach($it as $key=>$val)
! 20: {
! 21: echo "$key=>$val\n";
! 22: }
! 23:
! 24: echo "===Rewind===\n";
! 25:
! 26: foreach($it as $key=>$val)
! 27: {
! 28: echo "$key=>$val\n";
! 29: }
! 30:
! 31: echo "===Append===\n";
! 32:
! 33: $it->append(new ArrayIterator(array(2 => 'C', 3 => 'D')));
! 34:
! 35: foreach(new NoRewindIterator($it) as $key=>$val)
! 36: {
! 37: echo "$key=>$val\n";
! 38: }
! 39:
! 40: echo "===Rewind===\n";
! 41:
! 42: foreach($it as $key=>$val)
! 43: {
! 44: echo "$key=>$val\n";
! 45: }
! 46:
! 47: ?>
! 48: ===DONE===
! 49: <?php exit(0); ?>
! 50: --EXPECTF--
! 51: ===Empty===
! 52: ===Append===
! 53: 0=>A
! 54: 1=>B
! 55: ===Rewind===
! 56: 0=>A
! 57: 1=>B
! 58: ===Append===
! 59: 2=>C
! 60: 3=>D
! 61: ===Rewind===
! 62: 0=>A
! 63: 1=>B
! 64: 2=>C
! 65: 3=>D
! 66: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>