Removing calls to Dispatcher::_stop(). Updating tests. Fixes #1578

This commit is contained in:
mark_story 2011-03-09 22:27:19 -05:00
parent 95d44c3694
commit 0cc55d8f45
2 changed files with 10 additions and 31 deletions

View file

@ -302,13 +302,13 @@ class Dispatcher {
if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) {
$this->response->statusCode(404);
$this->response->send();
return $this->_stop();
return true;
} elseif ($isCss) {
include WWW_ROOT . DS . $filters['css'];
$this->_stop();
return true;
} elseif ($isJs) {
include WWW_ROOT . DS . $filters['js'];
$this->_stop();
return true;
}
$controller = null;
$pathSegments = explode('.', $url);

View file

@ -59,15 +59,6 @@ class TestDispatcher extends Dispatcher {
return $controller;
}
/**
* _stop method
*
* @return void
*/
protected function _stop() {
$this->stopped = true;
return true;
}
}
/**
@ -1356,9 +1347,8 @@ class DispatcherTest extends CakeTestCase {
));
ob_start();
$Dispatcher->asset('ccss/cake.generic.css');
$this->assertTrue($Dispatcher->asset('ccss/cake.generic.css'));
$result = ob_get_clean();
$this->assertTrue($Dispatcher->stopped);
}
/**
@ -1373,28 +1363,17 @@ class DispatcherTest extends CakeTestCase {
'js' => '',
'css' => ''
));
$Dispatcher->asset('theme/test_theme/ccss/cake.generic.css');
$this->assertTrue($Dispatcher->stopped);
$this->assertTrue($Dispatcher->asset('theme/test_theme/ccss/cake.generic.css'));
$Dispatcher->stopped = false;
$Dispatcher->asset('theme/test_theme/cjs/debug_kit.js');
$this->assertTrue($Dispatcher->stopped);
$this->assertTrue($Dispatcher->asset('theme/test_theme/cjs/debug_kit.js'));
$Dispatcher->stopped = false;
$Dispatcher->asset('test_plugin/ccss/cake.generic.css');
$this->assertTrue($Dispatcher->stopped);
$this->assertTrue($Dispatcher->asset('test_plugin/ccss/cake.generic.css'));
$Dispatcher->stopped = false;
$Dispatcher->asset('test_plugin/cjs/debug_kit.js');
$this->assertTrue($Dispatcher->stopped);
$this->assertTrue($Dispatcher->asset('test_plugin/cjs/debug_kit.js'));
$Dispatcher->stopped = false;
$Dispatcher->asset('css/ccss/debug_kit.css');
$this->assertFalse($Dispatcher->stopped);
$this->assertFalse($Dispatcher->asset('css/ccss/debug_kit.css'));
$Dispatcher->stopped = false;
$Dispatcher->asset('js/cjs/debug_kit.js');
$this->assertFalse($Dispatcher->stopped);
$this->assertFalse($Dispatcher->asset('js/cjs/debug_kit.js'));
}
/**
* testFullPageCachingDispatch method