Пример #1
0
 /**
  * @codeCoverageIgnore
  */
 protected function redirect($url = null, array $args = null)
 {
     if (is_null($url)) {
         throw new InvalidArgumentException('Param url is expected.');
     }
     $this->application->redirect($url, $args);
 }
Пример #2
0
 /**
  * @runInSeparateProcess
  */
 public function testRedirectShouldWork()
 {
     $_SERVER['SERVER_PROTOCOL'] = 'http';
     $_SERVER['HTTP_HOST'] = 'localhost';
     $router = $this->getRouter();
     $router->enableSearchEngineFriendly(false);
     $app = new Piano\Application($this->getConfig(), $router);
     $app->redirect('/application/index/index');
     $app->redirect('/application/index/index', ['id' => 5, 'value' => 'teste']);
     $app->redirect('/application');
     $app->redirect('/');
 }