Neos\Flow\Tests\Unit\Mvc\Controller\MvcPropertyMappingConfigurationServiceTest::initializePropertyMappingConfiguration PHP Метод

initializePropertyMappingConfiguration() защищенный Метод

Helper which initializes the property mapping configuration and returns arguments
protected initializePropertyMappingConfiguration ( array $trustedProperties ) : Arguments
$trustedProperties array
Результат Neos\Flow\Mvc\Controller\Arguments
    protected function initializePropertyMappingConfiguration(array $trustedProperties)
    {
        $request = $this->getMockBuilder(Mvc\ActionRequest::class)->setMethods(['getInternalArgument'])->disableOriginalConstructor()->getMock();
        $request->expects($this->any())->method('getInternalArgument')->with('__trustedProperties')->will($this->returnValue('fooTrustedProperties'));
        $arguments = new Mvc\Controller\Arguments();
        $mockHashService = $this->getMockBuilder(HashService::class)->setMethods(['validateAndStripHmac'])->getMock();
        $mockHashService->expects($this->once())->method('validateAndStripHmac')->with('fooTrustedProperties')->will($this->returnValue(serialize($trustedProperties)));
        $arguments->addNewArgument('foo', 'something');
        $this->inject($arguments->getArgument('foo'), 'propertyMappingConfiguration', new PropertyMappingConfiguration());
        $requestHashService = new Mvc\Controller\MvcPropertyMappingConfigurationService();
        $this->inject($requestHashService, 'hashService', $mockHashService);
        $requestHashService->initializePropertyMappingConfigurationFromRequest($request, $arguments);
        return $arguments;
    }