Skip to content

Commit 756b098

Browse files
committed
Router tests all pass now.
1 parent 328db0c commit 756b098

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cake/libs/route/cake_route.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ public function match($url) {
269269
return false;
270270
}
271271

272+
// Missing defaults is a fail.
273+
if (array_diff_key($defaults, $url) !== array()) {
274+
return false;
275+
}
276+
272277
$named = $pass = $diff = array();
273278

274279
foreach ($url as $key => $value) {
@@ -307,7 +312,6 @@ public function match($url) {
307312
}
308313
}
309314

310-
311315
//if a not a greedy route, no extra params are allowed.
312316
if (!$this->_greedy && ( (!empty($pass) || !empty($named)) || array_diff_key($diff, $keyNames) != array()) ) {
313317
return false;

cake/tests/cases/libs/router.test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ function testUrlGenerationWithLegacyPrefixes() {
15161516

15171517
$result = Router::url(array('controller' => 'images', 'action' => 'add'));
15181518
$expected = '/images/add';
1519-
$this->assertEqual($result, $expected);
1519+
$this->assertEquals($expected, $result);
15201520

15211521
$result = Router::url(array('controller' => 'images', 'action' => 'add', 'protected' => true));
15221522
$expected = '/protected/images/add';

0 commit comments

Comments
 (0)