Neos\FluidAdaptor\Tests\Unit\ViewHelpers\Form\AbstractFormFieldViewHelperTest::getMappingResultsForPropertyReturnsErrorsFromRequestIfPropertyIsSet PHP Метод

getMappingResultsForPropertyReturnsErrorsFromRequestIfPropertyIsSet() публичный Метод

    public function getMappingResultsForPropertyReturnsErrorsFromRequestIfPropertyIsSet()
    {
        $formViewHelper = $this->getAccessibleMock(\Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::class, array('isObjectAccessorMode'), array(), '', false);
        $this->injectDependenciesIntoViewHelper($formViewHelper);
        $formViewHelper->expects($this->once())->method('isObjectAccessorMode')->will($this->returnValue(true));
        $formViewHelper->_set('arguments', array('property' => 'bar'));
        $this->viewHelperVariableContainerData = array(\Neos\FluidAdaptor\ViewHelpers\FormViewHelper::class => array('formObjectName' => 'foo'));
        $expectedResult = $this->createMock(\Neos\Error\Messages\Result::class);
        $mockFormResult = $this->createMock(\Neos\Error\Messages\Result::class);
        $mockFormResult->expects($this->once())->method('forProperty')->with('foo.bar')->will($this->returnValue($expectedResult));
        $this->request->expects($this->once())->method('getInternalArgument')->with('__submittedArgumentValidationResults')->will($this->returnValue($mockFormResult));
        $actualResult = $formViewHelper->_call('getMappingResultsForProperty');
        $this->assertEquals($expectedResult, $actualResult);
    }
AbstractFormFieldViewHelperTest