Move meaningful message inside Exception thrown in Cache tests

This commit is contained in:
Hypolite Petovan 2018-07-08 01:46:06 -04:00
parent 9396b05659
commit 59c38d1b73
3 changed files with 3 additions and 6 deletions

View File

@ -19,8 +19,7 @@ class MemcacheCacheDriverTest extends MemoryCacheTest
try { try {
$this->cache = CacheDriverFactory::create('memcache'); $this->cache = CacheDriverFactory::create('memcache');
} catch (\Exception $exception) { } catch (\Exception $exception) {
print "Memcache - TestCase failed: " . $exception->getMessage(); throw new \Exception("Memcache - TestCase failed: " . $exception->getMessage(), $exception->getCode(), $exception);
throw new \Exception();
} }
return $this->cache; return $this->cache;
} else { } else {

View File

@ -19,8 +19,7 @@ class MemcachedCacheDriverTest extends MemoryCacheTest
try { try {
$this->cache = CacheDriverFactory::create('memcached'); $this->cache = CacheDriverFactory::create('memcached');
} catch (\Exception $exception) { } catch (\Exception $exception) {
print "Memcached - TestCase failed: " . $exception->getMessage(); throw new \Exception("Memcached - TestCase failed: " . $exception->getMessage(), $exception->getCode(), $exception);
throw new \Exception();
} }
return $this->cache; return $this->cache;
} else { } else {

View File

@ -19,8 +19,7 @@ class RedisCacheDriverTest extends MemoryCacheTest
try { try {
$this->cache = CacheDriverFactory::create('redis'); $this->cache = CacheDriverFactory::create('redis');
} catch (\Exception $exception) { } catch (\Exception $exception) {
print "Redis - TestCase failed: " . $exception->getMessage(); throw new \Exception("Redis - TestCase failed: " . $exception->getMessage(), $exception->getCode(), $exception);
throw new \Exception();
} }
return $this->cache; return $this->cache;
} else { } else {