Fix failing tests.

rawurlencode() and urlencode() handle utf8 differently.
This commit is contained in:
mark_story 2012-02-18 11:18:03 -05:00
parent 0ea00c5f07
commit fce70df6ff
2 changed files with 7 additions and 2 deletions

View file

@ -1121,7 +1121,7 @@ class CakeRequestTest extends CakeTestCase {
public function testGetParamWithUrlencodedElement() {
$_GET['/posts/add/∂∂'] = '';
$_SERVER['PHP_SELF'] = '/cake_dev/app/webroot/index.php';
$_SERVER['REQUEST_URI'] = '/cake_dev/posts/add/%2202%2202';
$_SERVER['REQUEST_URI'] = '/cake_dev/posts/add/%E2%88%82%E2%88%82';
$request = new CakeRequest();
$this->assertEquals(array(), $request->query);

View file

@ -519,7 +519,12 @@ class CakeRouteTest extends CakeTestCase {
array('action' => 'view')
);
$route->compile();
$result = $route->parse('/posts/%2202%2202');
$result = $route->parse('/posts/%E2%88%82%E2%88%82');
$this->assertEquals($result['controller'], 'posts');
$this->assertEquals($result['action'], 'view');
$this->assertEquals($result['slug'], '∂∂');
$result = $route->parse('/posts/∂∂');
$this->assertEquals($result['controller'], 'posts');
$this->assertEquals($result['action'], 'view');
$this->assertEquals($result['slug'], '∂∂');