Ejemplo n.º 1
0
 /**
  * @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument $this
  */
 protected function setupPropertyMapperAndSetValue()
 {
     $this->mockPropertyMapper->expects($this->once())->method('convert')->with('someRawValue', 'string', $this->mockConfiguration)->will($this->returnValue('convertedValue'));
     $this->mockPropertyMapper->expects($this->once())->method('getMessages')->will($this->returnValue(new \TYPO3\CMS\Extbase\Error\Result()));
     return $this->simpleValueArgument->setValue('someRawValue');
 }
 /**
  * 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;
         }
     }
 }