From 6585ecd962bde0e60c34b9ace2dc98e1a25f1453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Wed, 3 Jul 2019 12:21:17 +0200 Subject: [PATCH] Add Predis support --- src/Traits/BootstrapsTenancy.php | 2 +- tests/BootstrapsTenancyTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Traits/BootstrapsTenancy.php b/src/Traits/BootstrapsTenancy.php index 05e4f66d..4d2c50f5 100644 --- a/src/Traits/BootstrapsTenancy.php +++ b/src/Traits/BootstrapsTenancy.php @@ -34,7 +34,7 @@ trait BootstrapsTenancy $client = Redis::connection($connection)->client(); try { $client->setOption($client::OPT_PREFIX, $prefix); - } catch (\Exception $e) { + } catch (\Throwable $t) { throw new PhpRedisNotInstalledException(); } } diff --git a/tests/BootstrapsTenancyTest.php b/tests/BootstrapsTenancyTest.php index 9c171c16..e2c8b1ba 100644 --- a/tests/BootstrapsTenancyTest.php +++ b/tests/BootstrapsTenancyTest.php @@ -36,6 +36,7 @@ class BootstrapsTenancyTest extends TestCase public function predis_is_supported() { Config::set('database.redis.client', 'predis'); + Redis::setDriver('predis'); Config::set('tenancy.redis.multitenant', false); // assert no exception is thrown from initializing tenancy @@ -46,8 +47,8 @@ class BootstrapsTenancyTest extends TestCase public function predis_is_not_supported_without_disabling_redis_multitenancy() { Config::set('database.redis.client', 'predis'); + Redis::setDriver('predis'); - // todo $this->expectException(PhpRedisNotInstalledException::class); $this->initTenancy(); }