Browse Source

fixing some failing tests

Jose Lorenzo Rodriguez 11 years ago
parent
commit
2e7e01db99

+ 1 - 1
src/Auth/ControllerAuthorize.php

@@ -15,7 +15,7 @@
 namespace Cake\Auth;
 
 use Cake\Controller\Controller;
-use Cake\Error;
+use Cake\Core\Error;
 use Cake\Network\Request;
 
 /**

+ 7 - 7
src/Cache/Cache.php

@@ -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 @@ class Cache {
  * @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 @@ class Cache {
 			return [$group => self::$_groups[$group]];
 		}
 
-		throw new Error\Exception(sprintf('Invalid cache group %s', $group));
+		throw new Exception(sprintf('Invalid cache group %s', $group));
 	}
 
 /**

+ 4 - 4
src/Cache/CacheRegistry.php

@@ -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 @@ class CacheRegistry extends ObjectRegistry {
  * @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 @@ class CacheRegistry extends ObjectRegistry {
 		}
 
 		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))
 			);
 		}

+ 1 - 1
tests/TestCase/Error/ExceptionRendererTest.php

@@ -567,7 +567,7 @@ class ExceptionRendererTest extends TestCase {
 				500
 			),
 			array(
-				new Error\Exception('base class'),
+				new \Cake\Core\Error\Exception('base class'),
 				array('/Internal Error/'),
 				500
 			)