Instead of wiping the Router, just clear requests.

Clearing the router also removes routes which can cause assertions to
fail. By just removing the stored requests we avoid the error reported
in #8480 and not break as many tests.
This commit is contained in:
mark_story 2016-03-20 11:10:34 -04:00
parent 099369b94c
commit c6db76d044

View file

@ -280,7 +280,9 @@ abstract class ControllerTestCase extends CakeTestCase {
$this->result = $Dispatch->dispatch($request, $Dispatch->response, $params);
// Clear out any stored requests.
Router::reload();
while (Router::getRequest()) {
Router::popRequest();
}
$this->controller = $Dispatch->testController;
$this->vars = $this->controller->viewVars;