Skip to content
Permalink
Browse files

fixing some failing tests

  • Loading branch information...
lorenzo committed Aug 29, 2014
1 parent d12b1b4 commit 2e7e01db99b244d0ff1c2b77c4da4af79e5fcc71
@@ -15,7 +15,7 @@
namespace Cake\Auth;
use Cake\Controller\Controller;
use Cake\Error;
use Cake\Core\Error;
use Cake\Network\Request;
/**
@@ -14,9 +14,9 @@
*/
namespace Cake\Cache;
use Cake\Core\StaticConfigTrait;
use Cake\Cache\Engine\NullEngine;
use Cake\Error;
use Cake\Core\Error\Exception;
use Cake\Core\StaticConfigTrait;
/**
* Cache provides a consistent interface to Caching in your application. It allows you
@@ -100,14 +100,14 @@ class Cache {
*
* @param string $name Name of the config array that needs an engine instance built
* @return void
* @throws \Cake\Error\Exception When a cache engine cannot be created.
* @throws \Cake\Core\Error\Exception When a cache engine cannot be created.
*/
protected static function _buildEngine($name) {
if (empty(static::$_registry)) {
static::$_registry = new CacheRegistry();
}
if (empty(static::$_config[$name]['className'])) {
throw new Error\Exception(sprintf('The "%s" cache configuration does not exist.', $name));
throw new Exception(sprintf('The "%s" cache configuration does not exist.', $name));
}
$config = static::$_config[$name];
@@ -213,14 +213,14 @@ public static function write($key, $value, $config = 'default') {
* @param array $data An array of data to be stored in the cache
* @param string $config Optional string configuration name to write to. Defaults to 'default'
* @return array of bools for each key provided, indicating true for success or false for fail
* @throws \Cake\Core\Error\Exception
* @throws Cake\Core\Error\Exception
*/
public static function writeMany($data, $config = 'default') {
$engine = static::engine($config);
$return = $engine->writeMany($data);
foreach ($return as $key => $success) {
if ($success === false && !empty($data[$key])) {
throw new Error\Exception(sprintf(
throw new Exception(sprintf(
'%s cache was unable to write \'%s\' to %s cache',
$config,
$key,
@@ -405,7 +405,7 @@ public static function groupConfigs($group = null) {
return [$group => self::$_groups[$group]];
}
throw new Error\Exception(sprintf('Invalid cache group %s', $group));
throw new Exception(sprintf('Invalid cache group %s', $group));
}
/**
@@ -15,7 +15,7 @@
namespace Cake\Cache;
use Cake\Core\App;
use Cake\Error;
use Cake\Core\Error\Exception;
use Cake\Utility\ObjectRegistry;
/**
@@ -51,7 +51,7 @@ protected function _resolveClassName($class) {
* @throws \Cake\Core\Error\Exception
*/
protected function _throwMissingClassError($class, $plugin) {
throw new Error\Exception(sprintf('Cache engine %s is not available.', $class));
throw new Exception(sprintf('Cache engine %s is not available.', $class));
}
/**
@@ -77,13 +77,13 @@ protected function _create($class, $alias, $config) {
}
if (!($instance instanceof CacheEngine)) {
throw new Error\Exception(
throw new Exception(
'Cache engines must use Cake\Cache\CacheEngine as a base class.'
);
}
if (!$instance->init($config)) {
throw new Error\Exception(
throw new Exception(
sprintf('Cache engine %s is not properly configured.', get_class($instance))
);
}
@@ -567,7 +567,7 @@ public static function exceptionProvider() {
500
),
array(
new Error\Exception('base class'),
new \Cake\Core\Error\Exception('base class'),
array('/Internal Error/'),
500
)

0 comments on commit 2e7e01d

Please sign in to comment.
You can’t perform that action at this time.