Skip to content

Commit

Permalink
Adding a test case for route params with hyphens. Refs #974
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 31, 2010
1 parent 373bebb commit 5efddf9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cake/tests/cases/libs/router.test.php
Expand Up @@ -1786,7 +1786,7 @@ function testUrlWritingWithPrefixes() {
*/
function testUrlWritingWithPrefixesAndCustomRoutes() {
Router::connect(
'/admin/login',
'/admin/login',
array('controller' => 'users', 'action' => 'login', 'prefix' => 'admin', 'admin' => true)
);
Router::setRequestInfo(array(
Expand Down Expand Up @@ -2401,6 +2401,19 @@ function testMatchBasic() {
$result = $route->match($url);
$expected = '/admin/subscriptions/edit/1';
$this->assertEqual($result, $expected);

$route =& new CakeRoute('/articles/:date-from/:date-to', array(
'controller' => 'articles', 'action' => 'index'
));
$url = array(
'controller' => 'articles',
'action' => 'index',
'date-from' => '2009-07-31',
'date-to' => '2010-07-31'
);
$result = $route->match($url);
$expected = '/articles/2009-07-31/2010-07-31';
$this->assertEqual($result, $expected);
}

/**
Expand Down

0 comments on commit 5efddf9

Please sign in to comment.