/** * @test */ public function collectionValidatorCallsCollectionElementValidatorWhenValidatingObjectStorages() { $entity = new \TYPO3\CMS\Extbase\Tests\Fixture\Entity('Foo'); $elementType = \TYPO3\CMS\Extbase\Tests\Fixture\Entity::class; $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $objectStorage->attach($entity); $aValidator = new \TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator(array()); $this->mockValidatorResolver->expects($this->never())->method('createValidator'); $this->mockValidatorResolver->expects($this->once())->method('getBaseValidatorConjunction')->with($elementType)->will($this->returnValue($aValidator)); $this->validator->_set('options', array('elementType' => $elementType)); $this->validator->validate($objectStorage); }