tests/Routing/RouterTest.php
/**
     * Tests that a redirect route is properly generated and points to the RedirectActionController.
     */
Tests that a redirect route is properly generated and points to the RedirectActionController.
Tests that a redirect route is properly generated and points to the RedirectActionController .
public function testGenerateRedirectRoute()
    {
        $route = $this->router->createRedirectRoute('/', '/test', 301);
        $this->assertEquals(Router::$verbs, $route->methods());
        $this->assertEquals('/', $route->uri());
        $this->assertEquals('Horizon\Routing\Controllers\RedirectActionController::__invoke', $route->action());
        $this->assertEquals('/test', $route->getDefault('to'));
        $this->assertEquals(301, $route->getDefault('code'));
    }
public function testGenerateRedirectRoute ( ) { $ route = $ this -> router -> createRedirectRoute ( '/' , '/test' , 301 ) ; $ this -> assertEquals ( Router :: $ verbs , $ route -> methods ( ) ) ; $ this -> assertEquals ( '/' , $ route -> uri ( ) ) ; $ this -> assertEquals ( 'Horizon\Routing\Controllers\RedirectActionController::__invoke' , $ route -> action ( ) ) ; $ this -> assertEquals ( '/test' , $ route -> getDefault ( 'to' ) ) ; $ this -> assertEquals ( 301 , $ route -> getDefault ( 'code' ) ) ; }
Tests that a redirect route is properly generated and points to the RedirectActionController.
Tests that a redirect route is properly generated and points to the RedirectActionController .