mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removing calls to Dispatcher::_stop(). Updating tests. Fixes #1578
This commit is contained in:
parent
95d44c3694
commit
0cc55d8f45
2 changed files with 10 additions and 31 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue