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