From 08c2913b65affb03f1ca10ab59c6af5d43e71804 Mon Sep 17 00:00:00 2001 From: Adrien Foulon <6115458+Tofandel@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:47:51 +0100 Subject: [PATCH] Don't load DuskServiceProvider if dusk doesn't exist When running tests without dusk install this triggers an error --- src/TwillServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TwillServiceProvider.php b/src/TwillServiceProvider.php index cd93a6947..c5acf8180 100644 --- a/src/TwillServiceProvider.php +++ b/src/TwillServiceProvider.php @@ -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); }