mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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']))) {
|
if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) {
|
||||||
$this->response->statusCode(404);
|
$this->response->statusCode(404);
|
||||||
$this->response->send();
|
$this->response->send();
|
||||||
return $this->_stop();
|
return true;
|
||||||
} elseif ($isCss) {
|
} elseif ($isCss) {
|
||||||
include WWW_ROOT . DS . $filters['css'];
|
include WWW_ROOT . DS . $filters['css'];
|
||||||
$this->_stop();
|
return true;
|
||||||
} elseif ($isJs) {
|
} elseif ($isJs) {
|
||||||
include WWW_ROOT . DS . $filters['js'];
|
include WWW_ROOT . DS . $filters['js'];
|
||||||
$this->_stop();
|
return true;
|
||||||
}
|
}
|
||||||
$controller = null;
|
$controller = null;
|
||||||
$pathSegments = explode('.', $url);
|
$pathSegments = explode('.', $url);
|
||||||
|
|
|
@ -59,15 +59,6 @@ class TestDispatcher extends Dispatcher {
|
||||||
return $controller;
|
return $controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* _stop method
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function _stop() {
|
|
||||||
$this->stopped = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1356,9 +1347,8 @@ class DispatcherTest extends CakeTestCase {
|
||||||
));
|
));
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$Dispatcher->asset('ccss/cake.generic.css');
|
$this->assertTrue($Dispatcher->asset('ccss/cake.generic.css'));
|
||||||
$result = ob_get_clean();
|
$result = ob_get_clean();
|
||||||
$this->assertTrue($Dispatcher->stopped);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1373,28 +1363,17 @@ class DispatcherTest extends CakeTestCase {
|
||||||
'js' => '',
|
'js' => '',
|
||||||
'css' => ''
|
'css' => ''
|
||||||
));
|
));
|
||||||
$Dispatcher->asset('theme/test_theme/ccss/cake.generic.css');
|
$this->assertTrue($Dispatcher->asset('theme/test_theme/ccss/cake.generic.css'));
|
||||||
$this->assertTrue($Dispatcher->stopped);
|
|
||||||
|
|
||||||
$Dispatcher->stopped = false;
|
$this->assertTrue($Dispatcher->asset('theme/test_theme/cjs/debug_kit.js'));
|
||||||
$Dispatcher->asset('theme/test_theme/cjs/debug_kit.js');
|
|
||||||
$this->assertTrue($Dispatcher->stopped);
|
|
||||||
|
|
||||||
$Dispatcher->stopped = false;
|
$this->assertTrue($Dispatcher->asset('test_plugin/ccss/cake.generic.css'));
|
||||||
$Dispatcher->asset('test_plugin/ccss/cake.generic.css');
|
|
||||||
$this->assertTrue($Dispatcher->stopped);
|
|
||||||
|
|
||||||
$Dispatcher->stopped = false;
|
$this->assertTrue($Dispatcher->asset('test_plugin/cjs/debug_kit.js'));
|
||||||
$Dispatcher->asset('test_plugin/cjs/debug_kit.js');
|
|
||||||
$this->assertTrue($Dispatcher->stopped);
|
|
||||||
|
|
||||||
$Dispatcher->stopped = false;
|
$this->assertFalse($Dispatcher->asset('css/ccss/debug_kit.css'));
|
||||||
$Dispatcher->asset('css/ccss/debug_kit.css');
|
|
||||||
$this->assertFalse($Dispatcher->stopped);
|
|
||||||
|
|
||||||
$Dispatcher->stopped = false;
|
$this->assertFalse($Dispatcher->asset('js/cjs/debug_kit.js'));
|
||||||
$Dispatcher->asset('js/cjs/debug_kit.js');
|
|
||||||
$this->assertFalse($Dispatcher->stopped);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* testFullPageCachingDispatch method
|
* testFullPageCachingDispatch method
|
||||||
|
|
Loading…
Reference in a new issue