Skip to content

Commit

Permalink
Don't load DuskServiceProvider if dusk doesn't exist
Browse files Browse the repository at this point in the history
When running tests without dusk install this triggers an error
  • Loading branch information
Tofandel authored Nov 2, 2023
1 parent c97ef8d commit 08c2913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TwillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private function registerProviders(): void
$this->app->register($provider);
}

if (app()->environment('testing')) {
if (app()->environment('testing') && class_exists(Laravel\Dusk\Browser::class)) {
$this->app->register(DuskServiceProvider::class);
}

Expand Down

0 comments on commit 08c2913

Please sign in to comment.