From c6db76d044e7ceda23dbe9635b1aa60364fd8bc6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 20 Mar 2016 11:10:34 -0400 Subject: [PATCH] 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. --- lib/Cake/TestSuite/ControllerTestCase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index db1919259..020fcfe2c 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -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;