public function testToArrayCallsToArrayOnEachItemInCollection() { $item1 = $this->getMock('FOF30\\Registry\\Registry', array('toArray')); $item1->expects($this->once())->method('toArray')->will($this->returnValue('foo.array')); $item2 = $this->getMock('FOF30\\Registry\\Registry', array('toArray')); $item2->expects($this->once())->method('toArray')->will($this->returnValue('bar.array')); $c = new Collection(array($item1, $item2)); $results = $c->toArray(); $this->assertEquals(array('foo.array', 'bar.array'), $results); }