diff --git a/src/PHPUnit/Controller/AbstractControllerTestCase.php b/src/PHPUnit/Controller/AbstractControllerTestCase.php index 7d6a0fbcce..70d79c72e9 100644 --- a/src/PHPUnit/Controller/AbstractControllerTestCase.php +++ b/src/PHPUnit/Controller/AbstractControllerTestCase.php @@ -233,6 +233,7 @@ function(&$item, $key) { $item = $key . '=' . $item; } $request->setQuery(new Parameters($query)); $request->setPost(new Parameters($post)); $request->setUri($uri); + $request->setRequestUri($uri->getPath()); return $this; } diff --git a/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php b/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php index 2f113b0f06..ed6775bbbc 100644 --- a/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php +++ b/test/PHPUnit/Controller/AbstractControllerTestCaseTest.php @@ -233,4 +233,10 @@ public function testAssertApplicationErrorsEvents() $this->assertEquals(true, $result->stopped()); $this->assertEquals(Application::ERROR_ROUTER_NO_MATCH, $this->getApplication()->getMvcEvent()->getError()); } + + public function testDispatchRequestUri() + { + $this->dispatch('/tests'); + $this->assertEquals('/tests', $this->getApplication()->getRequest()->getRequestUri()); + } }