mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 00:14:04 +00:00
Add Predis support (#59)
* wip * Add Predis support * Enable phpredis extension only for some builds * Add note about phpredis * Fix if command * Revert travis changes & add a version check to predis tests
This commit is contained in:
parent
e7b5a77a6b
commit
1b6759084f
9 changed files with 75 additions and 18 deletions
|
|
@ -3,6 +3,8 @@
|
|||
namespace Stancl\Tenancy\Tests;
|
||||
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Stancl\Tenancy\Exceptions\PhpRedisNotInstalledException;
|
||||
|
||||
class BootstrapsTenancyTest extends TestCase
|
||||
{
|
||||
|
|
@ -30,6 +32,36 @@ class BootstrapsTenancyTest extends TestCase
|
|||
}
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function predis_is_supported()
|
||||
{
|
||||
if (app()->version() < 'v5.8.27') {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
Config::set('database.redis.client', 'predis');
|
||||
Redis::setDriver('predis');
|
||||
Config::set('tenancy.redis.tenancy', false);
|
||||
|
||||
// assert no exception is thrown from initializing tenancy
|
||||
$this->assertNotNull($this->initTenancy());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function predis_is_not_supported_without_disabling_redis_multitenancy()
|
||||
{
|
||||
if (app()->version() < 'v5.8.27') {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
Config::set('database.redis.client', 'predis');
|
||||
Redis::setDriver('predis');
|
||||
Config::set('tenancy.redis.tenancy', true);
|
||||
|
||||
$this->expectException(PhpRedisNotInstalledException::class);
|
||||
$this->initTenancy();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function filesystem_is_suffixed()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue