mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 19:14:03 +00:00
Restructure drivers config
This commit is contained in:
parent
6a9128474f
commit
b525747bc6
8 changed files with 18 additions and 23 deletions
|
|
@ -114,7 +114,7 @@ class TenantStorageTest extends TestCase
|
|||
/** @test */
|
||||
public function tenant_model_uses_correct_connection()
|
||||
{
|
||||
config(['tenancy.storage.db.connection' => 'foo']);
|
||||
config(['tenancy.storage_drivers.db.connection' => 'foo']);
|
||||
$this->assertSame('foo', (new TenantModel)->getConnectionName());
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ class TenantStorageTest extends TestCase
|
|||
]);
|
||||
config(['database.default' => 'sqlite']); // fix issue caused by loadMigrationsFrom
|
||||
|
||||
config(['tenancy.storage.db.custom_columns' => [
|
||||
config(['tenancy.storage_drivers.db.custom_columns' => [
|
||||
'foo',
|
||||
]]);
|
||||
|
||||
|
|
|
|||
|
|
@ -99,21 +99,13 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
'database.redis.client' => env('TENANCY_TEST_REDIS_CLIENT', 'phpredis'),
|
||||
'tenancy.redis.prefixed_connections' => ['default'],
|
||||
'tenancy.migrations_directory' => database_path('../migrations'),
|
||||
'tenancy.storage.db.connection' => 'central',
|
||||
'tenancy.storage_drivers.db.connection' => 'central',
|
||||
'tenancy.bootstrappers.redis' => \Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper::class,
|
||||
]);
|
||||
|
||||
$app->singleton(\Stancl\Tenancy\TenancyBootstrappers\RedisTenancyBootstrapper::class);
|
||||
|
||||
if (env('TENANCY_TEST_STORAGE_DRIVER', 'redis') === 'redis') {
|
||||
$app['config']->set([
|
||||
'tenancy.storage_driver' => RedisStorageDriver::class,
|
||||
]);
|
||||
} elseif (env('TENANCY_TEST_STORAGE_DRIVER', 'redis') === 'db') {
|
||||
$app['config']->set([
|
||||
'tenancy.storage_driver' => DatabaseStorageDriver::class,
|
||||
]);
|
||||
}
|
||||
$app['config']->set(['tenancy.storage_driver' => env('TENANCY_TEST_STORAGE_DRIVER', 'redis')]);
|
||||
}
|
||||
|
||||
protected function getPackageProviders($app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue