Skip to content
Browse files

Merge pull request #562 from hans-d/error_uri_colon

Request->_url gives wrong url for request_uri like controller/test:1
  • Loading branch information...
2 parents 86ec504 + 9ee2496 commit 5e4838529a4ff45c87319c80b481919272872d0f @nateabele nateabele committed Jul 10, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/cases/action/RequestTest.php
View
17 tests/cases/action/RequestTest.php
@@ -177,6 +177,23 @@ public function testRequestWithoutUrlQueryParam() {
$this->assertEqual('pages/test_app', $request->url);
}
+ public function testRequestWithColon() {
+ unset($_GET['url']);
+ $request = new Request(array('env' => array(
+ 'PHP_SELF' => '/test_app/app/webroot/index.php',
+ 'REQUEST_URI' => '/test_app/pages/test_app/test:a'
+ )));
+ $this->assertEqual('/test_app', $request->env('base'));
+ $this->assertEqual('pages/test_app/test:a', $request->url);
+
+ $request = new Request(array('env' => array(
+ 'PHP_SELF' => '/test_app/app/webroot/index.php',
+ 'REQUEST_URI' => '/test_app/pages/test_app/test:1'
+ )));
+ $this->assertEqual('/test_app', $request->env('base'));
+ $this->assertEqual('pages/test_app/test:1', $request->url);
+ }
+
public function testRequestWithoutUrlQueryParamAndNoApp() {
unset($_GET['url']);
$request = new Request(array('env' => array(

0 comments on commit 5e48385

Please sign in to comment.
Something went wrong with that request. Please try again.