mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Router tests all pass now.
This commit is contained in:
parent
328db0c36b
commit
756b09849f
2 changed files with 6 additions and 2 deletions
|
@ -269,6 +269,11 @@ class CakeRoute {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Missing defaults is a fail.
|
||||||
|
if (array_diff_key($defaults, $url) !== array()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$named = $pass = $diff = array();
|
$named = $pass = $diff = array();
|
||||||
|
|
||||||
foreach ($url as $key => $value) {
|
foreach ($url as $key => $value) {
|
||||||
|
@ -307,7 +312,6 @@ class CakeRoute {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//if a not a greedy route, no extra params are allowed.
|
//if a not a greedy route, no extra params are allowed.
|
||||||
if (!$this->_greedy && ( (!empty($pass) || !empty($named)) || array_diff_key($diff, $keyNames) != array()) ) {
|
if (!$this->_greedy && ( (!empty($pass) || !empty($named)) || array_diff_key($diff, $keyNames) != array()) ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1516,7 +1516,7 @@ class RouterTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = Router::url(array('controller' => 'images', 'action' => 'add'));
|
$result = Router::url(array('controller' => 'images', 'action' => 'add'));
|
||||||
$expected = '/images/add';
|
$expected = '/images/add';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
||||||
$result = Router::url(array('controller' => 'images', 'action' => 'add', 'protected' => true));
|
$result = Router::url(array('controller' => 'images', 'action' => 'add', 'protected' => true));
|
||||||
$expected = '/protected/images/add';
|
$expected = '/protected/images/add';
|
||||||
|
|
Loading…
Add table
Reference in a new issue