mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:34:03 +00:00
Default to default DB
This commit is contained in:
parent
29c8d5dab4
commit
f87c2b69ec
2 changed files with 13 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ namespace Stancl\Tenancy\Tests;
|
|||
|
||||
use Stancl\Tenancy\StorageDrivers\RedisStorageDriver;
|
||||
use Stancl\Tenancy\StorageDrivers\DatabaseStorageDriver;
|
||||
use Stancl\Tenancy\Tenant;
|
||||
|
||||
class TenantStorageTest extends TestCase
|
||||
{
|
||||
|
|
@ -140,4 +141,15 @@ class TenantStorageTest extends TestCase
|
|||
tenancy()->put('string', 'foo');
|
||||
$this->assertSame('string', \gettype(tenancy()->get('string')));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function tenant_model_uses_correct_connection()
|
||||
{
|
||||
config(['tenancy.storage.db.connection' => 'foo']);
|
||||
$this->assertSame('foo', (new Tenant)->getConnectionName());
|
||||
|
||||
config(['tenancy.storage.db.connection' => null]);
|
||||
config(['database.default' => 'foobar']);
|
||||
$this->assertSame('foobar', (new Tenant)->getConnectionName());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue