Fixing Cache tests

This commit is contained in:
José Lorenzo Rodríguez 2011-01-31 00:47:30 -04:30
parent ff5a809b29
commit 72c6e0cd58
4 changed files with 8 additions and 16 deletions

View file

@ -125,9 +125,9 @@ class Cache {
protected static function _buildEngine($name) {
$config = self::$_config[$name];
list($plugin, $class) = pluginSplit($config['engine']);
list($plugin, $class) = pluginSplit($config['engine'], true);
$cacheClass = $class . 'Engine';
App::uses($cacheClass, 'Cache/Engine');
App::uses($cacheClass, $plugin . 'Cache/Engine');
if (!class_exists($cacheClass)) {
return false;
}

View file

@ -16,9 +16,8 @@
* @since CakePHP(tm) v 1.2.0.5432
* @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
@ -234,19 +233,12 @@ class CacheTest extends CakeTestCase {
* @return void
*/
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();
$expecting = array(
'engine' => 'File',
'duration'=> 3600,
'probability' => 100,
'path'=> TMP . 'tests',
'prefix'=> 'cake_',
'lock' => false,
'serialize'=> true,
'isWindows' => DIRECTORY_SEPARATOR == '\\'
);
$expecting = $override + $initial;
$this->assertEqual($settings, $expecting);
}