Skip to content

Commit

Permalink
Adding test case, and removing unreachable code.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 9, 2009
1 parent 4421fe6 commit 17777af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 0 additions & 9 deletions cake/libs/router.php
Expand Up @@ -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']);

Expand Down
3 changes: 3 additions & 0 deletions cake/tests/cases/libs/router.test.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 17777af

Please sign in to comment.