redirect() public method

Create a redirect from a particular route name to another
public redirect ( $template, $name, $to )
Example #1
0
 public function testConnectingARedirectRoute()
 {
     $router = new Router();
     $router->connect('/user/{userid}', 'User.view');
     $router->redirect('/user/alias/{userid}', 'Alias.view', 'User.view');
     $response = $router->execute(new Http\Request('GET', '/user/alias/24'));
     $this->assertResponse($response, NULL, 302);
     $this->assertEquals($response->getHeaders()->value('Location'), '/user/24');
 }