/** * @test * @author Bastian Waidelich <*****@*****.**> */ public function resetSetsAllOptionsToTheirDefaultValue() { $this->uriBuilder->setArguments(array('test' => 'arguments'))->setSection('testSection')->setFormat('someFormat')->setCreateAbsoluteUri(TRUE)->setAddQueryString(TRUE)->setArgumentsToBeExcludedFromQueryString(array('test' => 'addQueryStringExcludeArguments')); $this->uriBuilder->reset(); $this->assertEquals(array(), $this->uriBuilder->getArguments()); $this->assertEquals('', $this->uriBuilder->getSection()); $this->assertEquals('', $this->uriBuilder->getFormat()); $this->assertEquals(FALSE, $this->uriBuilder->getCreateAbsoluteUri()); $this->assertEquals(FALSE, $this->uriBuilder->getAddQueryString()); $this->assertEquals(array(), $this->uriBuilder->getArgumentsToBeExcludedFromQueryString()); }
/** * Forwards the request to another action and / or controller. * * NOTE: This method only supports web requests and will throw an exception * if used with other request types. * * @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 $packageKey Key of the package containing the controller to forward to. If not specified, the current package is assumed. * @param array $arguments Array of arguments for the target action * @param integer $delay (optional) The delay in seconds. Default is no delay. * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other" * @param \F3\FLOW3\MVC\Controller\Arguments $arguments Arguments to pass to the target action * @return void * @throws \F3\FLOW3\MVC\Exception\StopActionException * @author Karsten Dambekalns <*****@*****.**> * @api */ protected function redirect($actionName, $controllerName = NULL, $packageKey = NULL, array $arguments = NULL, $delay = 0, $statusCode = 303) { if (!$this->request instanceof \F3\FLOW3\MVC\Web\Request) { throw new \F3\FLOW3\MVC\Exception\UnsupportedRequestTypeException('redirect() only supports web requests.', 1238101344); } if ($packageKey !== NULL && strpos($packageKey, '\\') !== FALSE) { list($packageKey, $subpackageKey) = explode('\\', $packageKey, 2); } else { $subpackageKey = NULL; } $uri = $this->uriBuilder->reset()->uriFor($actionName, $arguments, $controllerName, $packageKey, $subpackageKey); $this->redirectToUri($uri, $delay, $statusCode); }