Skip to content
Permalink
Browse files

Add failing tests for patches from 'teddyzeenny'.

  • Loading branch information...
markstory committed Feb 18, 2012
1 parent 2097d5a commit 2f51ef00ed4cd215e797c6c80c6c9aaeb2c4f34f
Showing with 31 additions and 0 deletions.
  1. +14 −0 lib/Cake/Test/Case/Network/CakeRequestTest.php
  2. +17 −0 lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php
@@ -1113,6 +1113,20 @@ public function testGetParamsWithDot() {
$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 @@ public function testParse() {
$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
*

0 comments on commit 2f51ef0

Please sign in to comment.
You can’t perform that action at this time.