mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 05:04:04 +00:00
Add test for tenants:migrate-fresh -v
This commit is contained in:
parent
af1231f025
commit
1f2a017a41
1 changed files with 15 additions and 0 deletions
|
|
@ -366,6 +366,21 @@ test('migrate fresh command works', function () {
|
||||||
expect(DB::table('users')->exists())->toBeFalse();
|
expect(DB::table('users')->exists())->toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('migrate fresh command only shows migration output when run with the verbose option', function () {
|
||||||
|
$tenant = Tenant::create();
|
||||||
|
|
||||||
|
// pest()->artisan()->expectsOutput() cannot observe the output suppression,
|
||||||
|
// so use Artisan::call() + Artisan::output() instead.
|
||||||
|
|
||||||
|
// By default the underlying tenants:migrate output is suppressed
|
||||||
|
Artisan::call('tenants:migrate-fresh');
|
||||||
|
expect(Artisan::output())->not()->toContain('Migrating tenant ' . $tenant->getTenantKey());
|
||||||
|
|
||||||
|
// Underlying tenants:migrate output is shown when the verbose option is passed
|
||||||
|
Artisan::call('tenants:migrate-fresh -v');
|
||||||
|
expect(Artisan::output())->toContain('Migrating tenant ' . $tenant->getTenantKey());
|
||||||
|
});
|
||||||
|
|
||||||
test('migrate fresh command respects force option in production', function () {
|
test('migrate fresh command respects force option in production', function () {
|
||||||
// Set environment to production
|
// Set environment to production
|
||||||
app()->detectEnvironment(fn() => 'production');
|
app()->detectEnvironment(fn() => 'production');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue