Skip to content

Commit

Permalink
Router tests all pass now.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 18, 2010
1 parent 328db0c commit 756b098
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cake/libs/route/cake_route.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ public function match($url) {
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) {
Expand Down Expand Up @@ -307,7 +312,6 @@ public function match($url) {
}
}


//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;
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/router.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ function testUrlGenerationWithLegacyPrefixes() {

$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';
Expand Down

0 comments on commit 756b098

Please sign in to comment.