Ejemplo n.º 1
0
 /**
  * @test
  */
 public function getInfoReturnsTheDataAssociatedWithTheCurrentIteratorEntry()
 {
     $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
     $object1 = new \StdClass();
     $object2 = new \StdClass();
     $object3 = new \StdClass();
     $objectStorage->attach($object1, 42);
     $objectStorage->attach($object2, 'foo');
     $objectStorage->attach($object3, array('bar', 'baz'));
     $objectStorage->rewind();
     $this->assertEquals($objectStorage->getInfo(), 42);
     $objectStorage->next();
     $this->assertEquals($objectStorage->getInfo(), 'foo');
     $objectStorage->next();
     $this->assertEquals($objectStorage->getInfo(), array('bar', 'baz'));
 }