Skip to content
Permalink
Browse files

Updating Dispatcher test to run correctly in CLI.

  • Loading branch information...
markstory committed Sep 19, 2010
1 parent cdda1bf commit d6b747cb25ca7c60522ee40f4b8cb5b66a7af148
Showing with 19 additions and 20 deletions.
  1. +19 −20 cake/tests/cases/dispatcher.test.php
@@ -18,13 +18,25 @@
* @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';
} elseif (!defined('APP_CONTROLLER_EXISTS')){
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 @@ protected function _invoke(&$controller, $params) {
return $controller;
}
/**
* cakeError method
*
* @param mixed $filename
* @return void
*/
public function cakeError($filename, $params) {
return array($filename, $params);
}
/**
* _stop method
*
@@ -69,15 +71,6 @@ protected function _stop() {
$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 @@ public function testFullPageCachingDispatch() {
), true);
$dispatcher = new TestDispatcher();
$dispatcher->response = $this->getMock('CakeResponse', array('_sendHeader'));
$url = '/';
ob_start();

0 comments on commit d6b747c

Please sign in to comment.
You can’t perform that action at this time.