Router tests all pass now.

This commit is contained in:
mark_story 2010-12-18 14:26:45 -05:00
parent 328db0c36b
commit 756b09849f
2 changed files with 6 additions and 2 deletions

View file

@ -269,6 +269,11 @@ class CakeRoute {
return false;
}
// Missing defaults is a fail.
if (array_diff_key($defaults, $url) !== array()) {
return false;
}
$named = $pass = $diff = array();
foreach ($url as $key => $value) {
@ -307,7 +312,6 @@ class CakeRoute {
}
}
//if a not a greedy route, no extra params are allowed.
if (!$this->_greedy && ( (!empty($pass) || !empty($named)) || array_diff_key($diff, $keyNames) != array()) ) {
return false;

View file

@ -1516,7 +1516,7 @@ class RouterTest extends CakeTestCase {
$result = Router::url(array('controller' => 'images', 'action' => 'add'));
$expected = '/images/add';
$this->assertEqual($result, $expected);
$this->assertEquals($expected, $result);
$result = Router::url(array('controller' => 'images', 'action' => 'add', 'protected' => true));
$expected = '/protected/images/add';