mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 01:54:03 +00:00
Add MigrateStatus command and corresponding tests
This commit is contained in:
parent
ab64f4599d
commit
ef47884331
3 changed files with 94 additions and 0 deletions
|
|
@ -106,6 +106,34 @@ class CommandsTest extends TestCase
|
|||
$this->assertFalse(Schema::hasTable('users'));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function migrate_status_command_works()
|
||||
{
|
||||
$tenant = Tenant::create();
|
||||
|
||||
$this->artisan('tenants:migrate-status')
|
||||
->expectsOutputToContain('Tenant: ' . $tenant->getTenantKey());
|
||||
|
||||
Artisan::call('tenants:migrate', ['--tenants' => [$tenant->getTenantKey()]]);
|
||||
|
||||
$this->artisan('tenants:migrate-status', ['--tenants' => [$tenant->getTenantKey()]])
|
||||
->expectsOutputToContain('Tenant: ' . $tenant->getTenantKey())
|
||||
->expectsOutputToContain('Ran');
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function migrate_status_command_works_with_multiple_tenants()
|
||||
{
|
||||
$tenant1 = Tenant::create()->getTenantKey();
|
||||
$tenant2 = Tenant::create()->getTenantKey();
|
||||
|
||||
Artisan::call('tenants:migrate', ['--tenants' => [$tenant1, $tenant2]]);
|
||||
|
||||
$this->artisan('tenants:migrate-status')
|
||||
->expectsOutputToContain('Tenant: ' . $tenant1)
|
||||
->expectsOutputToContain('Tenant: ' . $tenant2);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function seed_command_works()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue