mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 19:24:02 +00:00
Add Predis support
This commit is contained in:
parent
d2171b5dc5
commit
6585ecd962
2 changed files with 3 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue