Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixing some failing tests
  • Loading branch information
lorenzo committed Aug 29, 2014
1 parent d12b1b4 commit 2e7e01d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Auth/ControllerAuthorize.php
Expand Up @@ -15,7 +15,7 @@
namespace Cake\Auth;

use Cake\Controller\Controller;
use Cake\Error;
use Cake\Core\Error;
use Cake\Network\Request;

/**
Expand Down
14 changes: 7 additions & 7 deletions src/Cache/Cache.php
Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Cache/CacheRegistry.php
Expand Up @@ -15,7 +15,7 @@
namespace Cake\Cache;

use Cake\Core\App;
use Cake\Error;
use Cake\Core\Error\Exception;
use Cake\Utility\ObjectRegistry;

/**
Expand Down Expand Up @@ -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));
}

/**
Expand All @@ -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))
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Error/ExceptionRendererTest.php
Expand Up @@ -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
)
Expand Down

0 comments on commit 2e7e01d

Please sign in to comment.