diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index f6717e6bb..a98388baf 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -18,6 +18,7 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ require_once CAKE . 'dispatcher.php'; +App::import('Core', 'CakeResponse', false); if (!class_exists('AppController')) { require_once LIBS . 'controller' . DS . 'app_controller.php'; @@ -25,6 +26,17 @@ if (!class_exists('AppController')) { define('APP_CONTROLLER_EXISTS', true); } +/** + * A testing stub that doesn't send headers. + * + * @package cake.tests.cases + */ +class DispatcherMockCakeResponse extends CakeResponse { + protected function _sendHeader($name, $value = null) { + return $name . ' ' . $value; + } +} + /** * TestDispatcher class * @@ -50,16 +62,6 @@ class TestDispatcher extends Dispatcher { return $controller; } -/** - * cakeError method - * - * @param mixed $filename - * @return void - */ - public function cakeError($filename, $params) { - return array($filename, $params); - } - /** * _stop method * @@ -69,15 +71,6 @@ class TestDispatcher extends Dispatcher { $this->stopped = true; return true; } - -/** - * header method - * - * @return void - */ - public function header() { - - } } /** @@ -451,6 +444,13 @@ class TestCachedPagesController extends AppController { 'view' => '+2 sec' ); +/** + * Mock out the reponse object so it doesn't send headers. + * + * @var string + */ + protected $_responseClass = 'DispatcherMockCakeResponse'; + /** * viewPath property * @@ -1471,7 +1471,6 @@ class DispatcherTest extends CakeTestCase { ), true); $dispatcher = new TestDispatcher(); - $dispatcher->response = $this->getMock('CakeResponse', array('_sendHeader')); $url = '/'; ob_start();