mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
added test for check nested url
This commit is contained in:
parent
4dd13ef554
commit
57bd1ea5f9
1 changed files with 20 additions and 0 deletions
|
@ -403,6 +403,26 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$this->assertEquals('something else', $result['pass'][0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that keys at named parameters are urldecoded
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testParseNamedKeyUrlDecode() {
|
||||
Router::connectNamed(true);
|
||||
$route = new CakeRoute('/:controller/:action/*', array('plugin' => null));
|
||||
|
||||
// checking /post/index/user[0]:a/user[1]:b
|
||||
$result = $route->parse('/posts/index/user%5B0%5D:a/user%5B1%5D:b');
|
||||
$this->assertArrayHasKey('user', $result['named']);
|
||||
$this->assertEquals(array('a', 'b'), $result['named']['user']);
|
||||
|
||||
// checking /post/index/user[]:a/user[]:b
|
||||
$result = $route->parse('/posts/index/user%5B%5D:a/user%5B%5D:b');
|
||||
$this->assertArrayHasKey('user', $result['named']);
|
||||
$this->assertEquals(array('a', 'b'), $result['named']['user']);
|
||||
}
|
||||
|
||||
/**
|
||||
* test that named params with null/false are excluded
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue