1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
<?php
namespace Guzzle\Tests\Iterator;
use Guzzle\Iterator\AppendIterator;
class AppendIteratorTest extends \PHPUnit_Framework_TestCase
{
public function testTraversesIteratorsInOrder()
{
$a = new \ArrayIterator(array(
'a' => 1,
'b' => 2
));
$b = new \ArrayIterator(array());
$c = new \ArrayIterator(array(
'c' => 3,
'd' => 4
));
$i = new AppendIterator();
$i->append($a);
$i->append($b);
$i->append($c);
$this->assertEquals(array(1, 2, 3, 4), iterator_to_array($i, false));
}
}