artisan('migrate', ['--path' => 'database/migrations/']); $this->artisan('db:seed'); $this->app[Kernel::class]->setArtisan(null); } /** * Refresh a conventional test database. * * @return void */ protected function refreshTestDatabase() { if (! RefreshDatabaseState::$migrated) { $this->artisan('migrate:fresh', $this->migrateFreshUsing()); $this->app[Kernel::class]->setArtisan(null); $this->artisan('db:seed'); RefreshDatabaseState::$migrated = true; } $this->beginDatabaseTransaction(); } /** * The parameters that should be used when running "migrate:fresh". * * @return array */ protected function migrateFreshUsing() { return array_merge( [ '--drop-views' => $this->shouldDropViews(), '--drop-types' => $this->shouldDropTypes(), ], ); } }