mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add failing tests for patches from 'teddyzeenny'.
This commit is contained in:
parent
2097d5a968
commit
2f51ef00ed
2 changed files with 31 additions and 0 deletions
|
@ -1113,6 +1113,20 @@ class CakeRequestTest extends CakeTestCase {
|
|||
$this->assertEquals(array(), $request->query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a request with urlencoded bits in the main GET parameter are filtered out.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetParamWithUrlencodedElement() {
|
||||
$_GET['/posts/add/∂∂'] = '';
|
||||
$_SERVER['PHP_SELF'] = '/cake_dev/app/webroot/index.php';
|
||||
$_SERVER['REQUEST_URI'] = '/cake_dev/posts/add/%2202%2202';
|
||||
|
||||
$request = new CakeRequest();
|
||||
$this->assertEquals(array(), $request->query);
|
||||
}
|
||||
|
||||
/**
|
||||
* generator for environment configurations
|
||||
*
|
||||
|
|
|
@ -508,6 +508,23 @@ class CakeRouteTest extends CakeTestCase {
|
|||
$this->assertEquals($result['action'], 'index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that :key elements are urldecoded
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testParseUrlDecodeElements() {
|
||||
$route = new Cakeroute(
|
||||
'/:controller/:slug',
|
||||
array('action' => 'view')
|
||||
);
|
||||
$route->compile();
|
||||
$result = $route->parse('/posts/%2202%2202');
|
||||
$this->assertEquals($result['controller'], 'posts');
|
||||
$this->assertEquals($result['action'], 'view');
|
||||
$this->assertEquals($result['slug'], '∂∂');
|
||||
}
|
||||
|
||||
/**
|
||||
* test numerically indexed defaults, get appeneded to pass
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue