Ejemplo n.º 1
0
 public function testCollection()
 {
     $collection = new Collection();
     $this->assertEquals(0, $collection->count());
     $this->assertEquals(array(), $collection->toArray());
     $a = new Pet();
     $collection->push($a);
     $this->assertEquals(1, $collection->count());
     $this->assertEquals(array(array('id' => 123, 'name' => 'myName')), $collection->toArray());
     $this->assertInstanceOf('\\ArrayIterator', $collection->getIterator());
 }