Adding test case, and removing unreachable code.

This commit is contained in:
Mark Story 2009-12-08 21:43:29 -05:00
parent 4421fe6dc3
commit 17777af3d3
2 changed files with 3 additions and 9 deletions

View file

@ -1397,15 +1397,6 @@ class CakeRoute {
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']);

View file

@ -2299,6 +2299,9 @@ class CakeRouteTestCase extends CakeTestCase {
$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);
}
/**