Merge pull request #8497 from cakephp/issue-8480

Clear the router state after testAction().
This commit is contained in:
José Lorenzo Rodríguez 2016-03-19 17:45:22 +01:00
commit 099369b94c

View file

@ -278,6 +278,10 @@ abstract class ControllerTestCase extends CakeTestCase {
$Dispatch->testController = $this->controller;
$Dispatch->response = $this->getMock('CakeResponse', array('send', '_clearBuffer'));
$this->result = $Dispatch->dispatch($request, $Dispatch->response, $params);
// Clear out any stored requests.
Router::reload();
$this->controller = $Dispatch->testController;
$this->vars = $this->controller->viewVars;
$this->contents = $this->controller->response->body();