Neos\Flow\Tests\Unit\Validation\ValidatorResolverTest::buildBaseValidatorConjunctionSkipsPropertiesAnnotatedWithIgnoreValidation PHP Method

buildBaseValidatorConjunctionSkipsPropertiesAnnotatedWithIgnoreValidation() public method

    public function buildBaseValidatorConjunctionSkipsPropertiesAnnotatedWithIgnoreValidation()
    {
        $modelClassName = 'Model' . md5(uniqid(mt_rand(), true));
        eval('class ' . $modelClassName . '{}');
        $mockReflectionService = $this->createMock(ReflectionService::class);
        $mockReflectionService->expects($this->any())->method('getAllImplementationClassNamesForInterface')->will($this->returnValue([]));
        $mockReflectionService->expects($this->at(0))->method('getClassSchema')->will($this->returnValue(null));
        $mockReflectionService->expects($this->at(1))->method('getClassPropertyNames')->will($this->returnValue(['entityProperty']));
        $mockReflectionService->expects($this->at(2))->method('getPropertyTagsValues')->with($modelClassName, 'entityProperty')->will($this->returnValue(['var' => ['ToBeIgnored']]));
        $mockReflectionService->expects($this->at(3))->method('isPropertyAnnotatedWith')->with($modelClassName, 'entityProperty', Annotations\IgnoreValidation::class)->will($this->returnValue(true));
        $mockObjectManager = $this->createMock(ObjectManagerInterface::class);
        $mockObjectManager->expects($this->any())->method('get')->with(ReflectionService::class)->will($this->returnValue($mockReflectionService));
        $validatorResolver = $this->getAccessibleMock(ValidatorResolver::class, ['resolveValidatorObjectName', 'createValidator', 'getBaseValidatorConjunction']);
        $validatorResolver->_set('reflectionService', $mockReflectionService);
        $validatorResolver->_set('objectManager', $mockObjectManager);
        $validatorResolver->expects($this->never())->method('getBaseValidatorConjunction');
        $validatorResolver->_call('buildBaseValidatorConjunction', $modelClassName, $modelClassName, ['Default']);
    }
ValidatorResolverTest