Beispiel #1
0
 public function testGetIterator()
 {
     $list = new ItemsList();
     $list->setItems(array('John Doe', 'Frusciante', 'Foo Bar', 'Baz Bar'));
     $this->assertInstanceOf('chegamos\\entity\\container\\ItemsIterator', $list->getIterator());
     $this->assertCount(4, $list->getIterator());
     $list->add('DuneDue');
     $this->assertCount(5, $list->getIterator());
     $this->assertEquals('Frusciante', $list->getItem(1));
     $this->assertEquals('John Doe', $list->getIterator()->current());
 }
Beispiel #2
0
 public function __construct(ItemsList $list)
 {
     $this->items = $list->getItems();
 }