~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/spl/tests/iterator_013.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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===