Example #1
0
 public function testIteratorAggregateCollection()
 {
     $array = $this->getArrayData();
     $iterator = new \ArrayIterator($array);
     $data = new DelegatingIterator($iterator);
     $collection = new Collection($data);
     $this->assertSame($iterator, $collection->getRaw());
     $this->assertEquals($array[0], $collection->getPeek()->getRaw());
     $this->assertEquals($array[0], $collection->next()->getRaw());
     $this->assertEquals($array[1], $collection->next()->getRaw());
     $this->assertEquals($array[2], $collection->getPeek()->getRaw());
     $collection->rewind();
     $this->assertEquals($array[0], $collection->next()->getRaw());
 }