diff --git a/cache/Cacher.php b/cache/Cacher.php index 3760432..b662c57 100644 --- a/cache/Cacher.php +++ b/cache/Cacher.php @@ -27,7 +27,7 @@ class Cacher } $cache = new $cacher($config); if (!$cache instanceof Cache) { - throw new Exception('Cache driver "' . $cacher . '" must extends Cache'); + throw new InitializationException('Cache driver "' . $cacher . '" must extends Cache'); } self::$caches[$cacher] = $cache; } diff --git a/cache/MemcacheCache.php b/cache/MemcacheCache.php index a5f72e2..4b2e61f 100644 --- a/cache/MemcacheCache.php +++ b/cache/MemcacheCache.php @@ -40,7 +40,7 @@ class MemcacheCache extends Cache foreach ($config as $c) { foreach ($required as $option) { if (!isset($c[$option])) { - throw new Exception('Configuration must have a "' . $option . '".'); + throw new InitializationException('Configuration must have a "' . $option . '".'); } } $this->connection->addServer($c['hostname'], $c['port']); diff --git a/tests/cache/CacherTest.php b/tests/cache/CacherTest.php index dfcc565..803d082 100644 --- a/tests/cache/CacherTest.php +++ b/tests/cache/CacherTest.php @@ -15,6 +15,7 @@ require_once dirname(__FILE__) . '/../../cache/Cache.php'; require_once dirname(__FILE__) . '/../../cache/Cacher.php'; require_once dirname(__FILE__) . '/../../Registry.php'; require_once dirname(__FILE__) . '/../../Config.php'; +require_once dirname(__FILE__) . '/../../exception/InitializationException.php'; class CacherTest extends PHPUnit_Framework_TestCase { @@ -27,7 +28,7 @@ class CacherTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException InitializationException * @expectedExcepptionMessage Cache driver */ public function testNotExtendsCache() diff --git a/tests/cache/MemcacheCacheTest.php b/tests/cache/MemcacheCacheTest.php index 4ff2959..c551ad2 100644 --- a/tests/cache/MemcacheCacheTest.php +++ b/tests/cache/MemcacheCacheTest.php @@ -15,6 +15,7 @@ require_once dirname(__FILE__) . '/../../cache/Cache.php'; require_once dirname(__FILE__) . '/../../cache/MemcacheCache.php'; +require_once dirname(__FILE__) . '/../../exception/InitializationException.php'; class MemcacheCacheTest extends PHPUnit_Framework_TestCase { @@ -36,7 +37,7 @@ class MemcacheCacheTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException InitializationException * @expectedExceptionMessage Configuration must have a * @TODO: MemcacheCache::__construct - empty config array passes with no host params */