mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 12:54:05 +00:00
Add test for tenancy.database.based_on null
This commit is contained in:
parent
c475e7a43d
commit
74aead2a60
3 changed files with 17 additions and 2 deletions
|
|
@ -31,4 +31,19 @@ class DatabaseManagerTest extends TestCase
|
|||
|
||||
$this->assertSame(config('database.connections.fooconn.database'), database_path('foodb'));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function the_default_db_is_used_when_based_on_is_null()
|
||||
{
|
||||
$this->assertSame('sqlite', config('database.default'));
|
||||
config([
|
||||
'database.connections.sqlite.foo' => 'bar',
|
||||
'tenancy.database.based_on' => null,
|
||||
]);
|
||||
|
||||
tenancy()->init('test.localhost');
|
||||
|
||||
$this->assertSame('tenant', config('database.default'));
|
||||
$this->assertSame('bar', config('database.connections.' . config('database.default') . '.foo'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue