/**
  * Sets the value for the given argument.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument
  * @param string $argumentName
  * @throws \Exception
  * @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
  * @throws \TYPO3\CMS\Extbase\Property\Exception
  */
 protected function setArgumentValue($argument, $argumentName)
 {
     try {
         $argument->setValue($this->request->getArgument($argumentName));
     } catch (\TYPO3\CMS\Extbase\Property\Exception $e) {
         if ($argumentName !== 'news') {
             throw $e;
         }
         if (!$e->getPrevious() instanceof \TYPO3\CMS\Extbase\Property\Exception\TargetNotFoundException && !$e->getPrevious() instanceof \TYPO3\CMS\Extbase\Property\Exception\InvalidSourceException) {
             throw $e;
         }
     }
 }
Пример #2
0
 /**
  * @test
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 public function defaultPropertyMappingConfigurationDoesNotAllowCreationOrModificationOfObjects()
 {
     $this->assertNull($this->simpleValueArgument->getPropertyMappingConfiguration()->getConfigurationValue('TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\PersistentObjectConverter', \TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED));
     $this->assertNull($this->simpleValueArgument->getPropertyMappingConfiguration()->getConfigurationValue('TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\PersistentObjectConverter', \TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED));
 }
 /**
  * Helper which enables the deprecated property mapper in the Argument class.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument
  */
 protected function enableDeprecatedPropertyMapperInArgument(\TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument)
 {
     $mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $mockConfigurationManager->expects($this->any())->method('isFeatureEnabled')->with('rewrittenPropertyMapper')->will($this->returnValue(FALSE));
     $argument->_set('configurationManager', $mockConfigurationManager);
 }