Permalink
Browse files

Adding test case, and removing unreachable code.

  • Loading branch information...
1 parent 4421fe6 commit 17777af3d32d9e886576630ada18736cc2db1a2f @markstory markstory committed Dec 9, 2009
Showing with 3 additions and 9 deletions.
  1. +0 −9 cake/libs/router.php
  2. +3 −0 cake/tests/cases/libs/router.test.php
View
@@ -1397,15 +1397,6 @@ function match($url) {
return false;
}
- //check that required passed parameters are the same.
- $i = 0;
- while (isset($defaults[$i])) {
- if (isset($url[$i]) && $defaults[$i] !== $url[$i]) {
- return false;
- }
- $i++;
- }
-
$passedArgsAndParams = array_diff_key($diff, $filteredDefaults, $keyNames);
list($named, $params) = Router::getNamedElements($passedArgsAndParams, $url['controller'], $url['action']);
@@ -2299,6 +2299,9 @@ function testMatchWithNamedParametersAndPassedArgs() {
$result = $route->match(array('controller' => 'pages', 'action' => 'display', 2, 'something'));
$this->assertEqual($result, '/test2/something');
+
+ $result = $route->match(array('controller' => 'pages', 'action' => 'display', 5, 'something'));
+ $this->assertFalse($result);
}
/**

0 comments on commit 17777af

Please sign in to comment.