mediaPath = test_path('songs'); /** @var Kernel $artisan */ $artisan = $app->make(Artisan::class); $artisan->bootstrap(); // Unless the DB is stored in memory, we need to migrate the DB only once for the whole test suite. if (!TestCase::$migrated || DB::connection()->getDatabaseName() === ':memory:') { $artisan->call('migrate'); if (!User::query()->count()) { $artisan->call('db:seed'); } TestCase::$migrated = true; } return $app; } }