artisan = $app->make(Artisan::class); $this->artisan->bootstrap(); $this->coverPath = $app->basePath().'/public/img/covers'; return $app; } private function prepareForTests() { $this->artisan->call('migrate'); if (!User::all()->count()) { $this->artisan->call('db:seed'); } if (!file_exists($this->coverPath)) { mkdir($this->coverPath, 0777, true); } } }