From 59c38d1b731fec295a08d88be3535496f6219724 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 8 Jul 2018 01:46:06 -0400 Subject: [PATCH] Move meaningful message inside Exception thrown in Cache tests --- tests/src/Core/Cache/MemcacheCacheDriverTest.php | 3 +-- tests/src/Core/Cache/MemcachedCacheDriverTest.php | 3 +-- tests/src/Core/Cache/RedisCacheDriverTest.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/src/Core/Cache/MemcacheCacheDriverTest.php b/tests/src/Core/Cache/MemcacheCacheDriverTest.php index d2078236e2..5ed0a3a2e5 100644 --- a/tests/src/Core/Cache/MemcacheCacheDriverTest.php +++ b/tests/src/Core/Cache/MemcacheCacheDriverTest.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 { diff --git a/tests/src/Core/Cache/MemcachedCacheDriverTest.php b/tests/src/Core/Cache/MemcachedCacheDriverTest.php index 2484517424..4872546b54 100644 --- a/tests/src/Core/Cache/MemcachedCacheDriverTest.php +++ b/tests/src/Core/Cache/MemcachedCacheDriverTest.php @@ -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 { diff --git a/tests/src/Core/Cache/RedisCacheDriverTest.php b/tests/src/Core/Cache/RedisCacheDriverTest.php index e13d95df4d..158534602a 100644 --- a/tests/src/Core/Cache/RedisCacheDriverTest.php +++ b/tests/src/Core/Cache/RedisCacheDriverTest.php @@ -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 { -- 2.39.5