/** * @test */ public function theStorageCanBeRetrievedAsArray() { $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $object1 = new \StdClass(); $object2 = new \StdClass(); $objectStorage->attach($object1, 'foo'); $objectStorage->attach($object2, 'bar'); $this->assertEquals($objectStorage->toArray(), array($object1, $object2)); }