Skip to content

Commit

Permalink
Test that RouterCollection::routes() gets the list of connected routes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bar committed Apr 1, 2014
1 parent 6e028ca commit 60cca76
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/TestCase/Routing/RouterTest.php
Expand Up @@ -332,6 +332,25 @@ public function testMapResourcesConnectOptions() {
$this->assertEquals('^(bar)$', $route->options['foo']);
}

/**
* Test that RouterCollection::routes() gets the list of connected routes.
*
* @return void
*/
public function testRouteCollectionRoutes() {
$collection = new RouteCollection();
Router::setRouteCollection($collection);
Router::mapResources('Posts');

$routes = $collection->routes();

$this->assertEquals(count($routes), 6);
$this->assertInstanceOf('Cake\Routing\Route\Route', $routes[0]);
$this->assertEquals($collection->get(0), $routes[0]);
$this->assertInstanceOf('Cake\Routing\Route\Route', $routes[5]);
$this->assertEquals($collection->get(5), $routes[5]);
}

/**
* Test mapResources with a plugin and prefix.
*
Expand Down

0 comments on commit 60cca76

Please sign in to comment.