diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index f891f35da..98611bf9b 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -265,7 +265,7 @@ abstract class ControllerTestCase extends CakeTestCase { ->will($this->returnValue($options['data'])); } - $Dispatch = new ControllerTestDispatcher(); + $Dispatch = $this->createDispatcher(); foreach (Router::$routes as $route) { if ($route instanceof RedirectRoute) { $route->response = $this->getMock('CakeResponse', array('send')); @@ -315,6 +315,15 @@ abstract class ControllerTestCase extends CakeTestCase { return $this->{$options['return']}; } +/** + * Creates the test dispatcher class + * + * @return Dispatcher + */ + protected function createDispatcher() { + return new ControllerTestDispatcher(); + } + /** * Generates a mocked controller and mocks any classes passed to `$mocks`. By * default, `_stop()` is stubbed as is sending the response headers, so to not