Add failing tests for patches from 'teddyzeenny'.

This commit is contained in:
mark_story 2012-02-18 10:53:47 -05:00
parent 2097d5a968
commit 2f51ef00ed
2 changed files with 31 additions and 0 deletions

View file

@ -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
*

View file

@ -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
*