Move meaningful message inside Exception thrown in Cache tests

pull/5295/head
Hypolite Petovan 4 years ago
parent 9396b05659
commit 59c38d1b73
  1. 3
      tests/src/Core/Cache/MemcacheCacheDriverTest.php
  2. 3
      tests/src/Core/Cache/MemcachedCacheDriverTest.php
  3. 3
      tests/src/Core/Cache/RedisCacheDriverTest.php

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

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

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

Loading…
Cancel
Save