mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing Cache tests
This commit is contained in:
parent
ff5a809b29
commit
72c6e0cd58
4 changed files with 8 additions and 16 deletions
|
@ -125,9 +125,9 @@ class Cache {
|
||||||
protected static function _buildEngine($name) {
|
protected static function _buildEngine($name) {
|
||||||
$config = self::$_config[$name];
|
$config = self::$_config[$name];
|
||||||
|
|
||||||
list($plugin, $class) = pluginSplit($config['engine']);
|
list($plugin, $class) = pluginSplit($config['engine'], true);
|
||||||
$cacheClass = $class . 'Engine';
|
$cacheClass = $class . 'Engine';
|
||||||
App::uses($cacheClass, 'Cache/Engine');
|
App::uses($cacheClass, $plugin . 'Cache/Engine');
|
||||||
if (!class_exists($cacheClass)) {
|
if (!class_exists($cacheClass)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,8 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.5432
|
* @since CakePHP(tm) v 1.2.0.5432
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
if (!class_exists('Cache')) {
|
|
||||||
require LIBS . 'cache.php';
|
App::uses('Cache', 'Cache');
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CacheTest class
|
* CacheTest class
|
||||||
|
@ -234,19 +233,12 @@ class CacheTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testInitSettings() {
|
function testInitSettings() {
|
||||||
Cache::config('default', array('engine' => 'File', 'path' => TMP . 'tests'));
|
$initial = Cache::settings();
|
||||||
|
$override = array('engine' => 'File', 'path' => TMP . 'tests');
|
||||||
|
Cache::config('default', $override);
|
||||||
|
|
||||||
$settings = Cache::settings();
|
$settings = Cache::settings();
|
||||||
$expecting = array(
|
$expecting = $override + $initial;
|
||||||
'engine' => 'File',
|
|
||||||
'duration'=> 3600,
|
|
||||||
'probability' => 100,
|
|
||||||
'path'=> TMP . 'tests',
|
|
||||||
'prefix'=> 'cake_',
|
|
||||||
'lock' => false,
|
|
||||||
'serialize'=> true,
|
|
||||||
'isWindows' => DIRECTORY_SEPARATOR == '\\'
|
|
||||||
);
|
|
||||||
$this->assertEqual($settings, $expecting);
|
$this->assertEqual($settings, $expecting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue