1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 23:54:03 +00:00
This commit is contained in:
Samuel Štancl 2019-02-26 23:07:01 +01:00
parent 0b6af429de
commit f9a819215f

View file

@ -45,17 +45,19 @@ class CommandsTest extends TestCase
{
// connection is sqlite
dump(Schema::getConnection()->getName());
$tenant = tenant()->create('test.localhost');
Artisan::call('tenants:migrate', [
'--tenants' => [$tenant['uuid']]
]);
tenancy()->init('localhost'); // reconnect the DB
// connection should be tenant at this point. is still sqlite
dump(Schema::getConnection()->getName());
// if you remove line 47, connection will be tenant at this point
dd('stop');
$tenant = tenant()->create('test.localhost');
Artisan::call('tenants:migrate', [
'--tenants' => [$tenant['uuid']]
]);
$this->assertFalse(Schema::hasTable('users'));
tenancy()->init('localhost');
$this->assertFalse(Schema::hasTable('users'));