diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index 0ab340e8bc7..4cd44ad14ec 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -178,6 +178,7 @@ public static function config($key, $config = null) { } if (isset($config['engine']) && empty($config['className'])) { $config['className'] = $config['engine']; + unset($config['engine']); } static::$_config[$key] = $config; } diff --git a/lib/Cake/Cache/CacheRegistry.php b/lib/Cake/Cache/CacheRegistry.php index adeedd42fc4..51f66bdfa22 100644 --- a/lib/Cake/Cache/CacheRegistry.php +++ b/lib/Cake/Cache/CacheRegistry.php @@ -58,7 +58,7 @@ protected function _throwMissingClassError($class, $plugin) { * Create the cache engine instance. * * Part of the template method for Cake\Utility\ObjectRegistry::load() - * @param string|CacheEngine $class The classname or object to make. + * @param string|CacheEngine|Closure $class The classname or object to make, or a closure factory. * @param array $settings An array of settings to use for the cache engine. * @return CacheEngine The constructed CacheEngine class. * @throws Cake\Error\Exception when an object doesn't implement diff --git a/lib/Cake/Test/TestCase/Cache/CacheTest.php b/lib/Cake/Test/TestCase/Cache/CacheTest.php index d4a6c93dffa..34531c322ca 100644 --- a/lib/Cake/Test/TestCase/Cache/CacheTest.php +++ b/lib/Cake/Test/TestCase/Cache/CacheTest.php @@ -219,7 +219,7 @@ public function testConfigRead() { Cache::config('tests', $settings); $expected = $settings; $expected['className'] = $settings['engine']; - unset($settings['engine']); + unset($expected['engine']); $this->assertEquals($expected, Cache::config('tests')); }