Example #1
0
 /**
  * @test
  */
 public function internalArgumentsMayHaveObjectValues()
 {
     $httpRequest = HttpRequest::create(new Uri('http://robertlemke.com/blog'));
     $someObject = new \stdClass();
     $actionRequest = new ActionRequest($httpRequest);
     $actionRequest->setArgument('__someInternalArgument', $someObject);
     $this->assertSame($someObject, $actionRequest->getInternalArgument('__someInternalArgument'));
 }
 /**
  * Initialize the property mapping configuration in $controllerArguments if
  * the trusted properties are set inside the request.
  *
  * @param \TYPO3\FLOW3\Mvc\ActionRequest $request
  * @param \TYPO3\FLOW3\Mvc\Controller\Arguments $controllerArguments
  * @return void
  */
 public function initializePropertyMappingConfigurationFromRequest(\TYPO3\FLOW3\Mvc\ActionRequest $request, \TYPO3\FLOW3\Mvc\Controller\Arguments $controllerArguments)
 {
     $trustedPropertiesToken = $request->getInternalArgument('__trustedProperties');
     if (!is_string($trustedPropertiesToken)) {
         return;
     }
     $serializedTrustedProperties = $this->hashService->validateAndStripHmac($trustedPropertiesToken);
     $trustedProperties = unserialize($serializedTrustedProperties);
     foreach ($trustedProperties as $propertyName => $propertyConfiguration) {
         if (!$controllerArguments->hasArgument($propertyName)) {
             continue;
         }
         $propertyMappingConfiguration = $controllerArguments->getArgument($propertyName)->getPropertyMappingConfiguration();
         $this->modifyPropertyMappingConfiguration($propertyConfiguration, $propertyMappingConfiguration);
     }
 }