Skip to content

Commit

Permalink
Added test for custom redirect route class
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyharris committed Sep 21, 2017
1 parent 61343cc commit dbdaae8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TestCase/Routing/RouteBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,21 @@ public function testRedirect()
$this->assertEquals('/forums', $route->redirect[0]);
}

/**
* Test using a custom route class for redirect routes.
*
* @return void
*/
public function testRedirectWithCustomRouteClass()
{
$routes = new RouteBuilder($this->collection, '/');

$routes->redirect('/old', '/forums', ['status' => 301, 'routeClass' => 'InflectedRoute']);
$route = $this->collection->routes()[0];

$this->assertInstanceOf(InflectedRoute::class, $route);
}

/**
* Test creating sub-scopes with prefix()
*
Expand Down

0 comments on commit dbdaae8

Please sign in to comment.