/** * Forwards the request to another action and / or controller. * * Request is directly transfered to the other action / controller * without the need for a new request. * * @param string $actionName Name of the action to forward to * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used. * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed. * @param array $arguments Arguments to pass to the target action * @return void * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException * @see redirect() * @api */ public function forward($actionName, $controllerName = NULL, $extensionName = NULL, array $arguments = NULL) { $this->request->setDispatched(FALSE); $this->request->setControllerActionName($actionName); if ($controllerName !== NULL) { $this->request->setControllerName($controllerName); } if ($extensionName !== NULL) { $this->request->setControllerExtensionName($extensionName); } if ($arguments !== NULL) { $this->request->setArguments($arguments); } throw new \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException(); }
/** * Test for render() * * @param array $settings * @param array $fieldProperties * @param array $additionalAttributes * @param string $value * @param array $expectedResult * @return void * @dataProvider renderReturnsArrayDataProvider * @test */ public function renderReturnsArray($settings, $fieldProperties, $additionalAttributes, $value, $expectedResult) { $field = new Field(); foreach ($fieldProperties as $propertyName => $propertyValue) { $field->_setProperty($propertyName, $propertyValue); } $this->abstractValidationViewHelperMock->_set('settings', $settings); $this->abstractValidationViewHelperMock->_set('extensionName', 'powermail'); $this->abstractValidationViewHelperMock->_set('test', true); $controllerContext = new ControllerContext(); $request = new Request(); $request->setControllerExtensionName('powermail'); $controllerContext->setRequest($request); $this->abstractValidationViewHelperMock->_set('controllerContext', $controllerContext); $result = $this->abstractValidationViewHelperMock->_callRef('render', $field, $additionalAttributes, $value); $this->assertSame($expectedResult, $result); }