File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 366366 expect (DB ::table ('users ' )->exists ())->toBeFalse ();
367367});
368368
369+ test ('migrate fresh command only shows migration output when run with the verbose option ' , function () {
370+ $ tenant = Tenant::create ();
371+
372+ // pest()->artisan()->expectsOutput() cannot observe the output suppression,
373+ // so use Artisan::call() + Artisan::output() instead.
374+
375+ // By default the underlying tenants:migrate output is suppressed
376+ Artisan::call ('tenants:migrate-fresh ' );
377+ expect (Artisan::output ())->not ()->toContain ('Migrating tenant ' . $ tenant ->getTenantKey ());
378+
379+ // Underlying tenants:migrate output is shown when the verbose option is passed
380+ Artisan::call ('tenants:migrate-fresh -v ' );
381+ expect (Artisan::output ())->toContain ('Migrating tenant ' . $ tenant ->getTenantKey ());
382+ });
383+
369384test ('migrate fresh command respects force option in production ' , function () {
370385 // Set environment to production
371386 app ()->detectEnvironment (fn () => 'production ' );
You can’t perform that action at this time.
0 commit comments