Skip to content

Commit

Permalink
Add tests for url generated with named route.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 10, 2014
1 parent 084651d commit 0ae87e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/TestCase/Routing/RouterTest.php
Expand Up @@ -1050,6 +1050,12 @@ public function testUrlGenerationNamedRoute() {
array('controller' => 'users', 'action' => 'view'),
array('_name' => 'test')
);
Router::connect(
'/view/*',
['action' => 'view'],
['_name' => 'Articles::view']
);

$url = Router::url('test', array('name' => 'mark'));
$this->assertEquals('/users/mark', $url);

Expand All @@ -1058,6 +1064,12 @@ public function testUrlGenerationNamedRoute() {

$url = Router::url('users-index');
$this->assertEquals('/users', $url);

$url = Router::url('Articles::view');
$this->assertEquals('/view/', $url);

$url = Router::url('Articles::view', ['1']);
$this->assertEquals('/view/1', $url);
}

/**
Expand Down

0 comments on commit 0ae87e3

Please sign in to comment.