Skip to content

Commit

Permalink
Fixing Cache tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 31, 2011
1 parent ff5a809 commit 72c6e0c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Cache/Cache.php
Expand Up @@ -125,9 +125,9 @@ public static function config($name = null, $settings = array()) {
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;
}
Expand Down
20 changes: 6 additions & 14 deletions lib/Cake/tests/cases/libs/cache.test.php
Expand Up @@ -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
Expand Down Expand Up @@ -234,19 +233,12 @@ function testConfigured() {
* @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);
}

Expand Down

0 comments on commit 72c6e0c

Please sign in to comment.