mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #13446 from garethellis36/ControllerTestCase/create-dispatcher
2.x - Moves creation of ControllerTestDispatcher to its own protected method
This commit is contained in:
commit
31dbda0a71
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue