mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test case, and removing unreachable code.
This commit is contained in:
parent
4421fe6dc3
commit
17777af3d3
2 changed files with 3 additions and 9 deletions
|
@ -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']);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue