mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding tests for querystring reversal.
This commit is contained in:
parent
886cd9e719
commit
5b78a662e8
2 changed files with 12 additions and 1 deletions
|
@ -997,7 +997,7 @@ class Router {
|
|||
unset($params['pass'], $params['named'], $params['url'], $url['url']);
|
||||
$params = array_merge($params, $pass, $named);
|
||||
if (!empty($url)) {
|
||||
$params['q'] = $url;
|
||||
$params['?'] = $url;
|
||||
}
|
||||
return Router::url($params);
|
||||
}
|
||||
|
|
|
@ -1980,6 +1980,17 @@ class RouterTest extends CakeTestCase {
|
|||
);
|
||||
$result = Router::reverse($params);
|
||||
$this->assertEqual($result, '/eng/posts/view/1');
|
||||
|
||||
$params = array(
|
||||
'lang' => 'eng',
|
||||
'controller' => 'posts',
|
||||
'action' => 'view',
|
||||
'pass' => array(1),
|
||||
'named' => array(),
|
||||
'url' => array('url' => 'eng/posts/view/1', 'foo' => 'bar', 'baz' => 'quu')
|
||||
);
|
||||
$result = Router::reverse($params);
|
||||
$this->assertEqual($result, '/eng/posts/view/1?foo=bar&baz=quu');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue