Skip to content

Commit

Permalink
Don't load DuskServiceProvider if dusk doesn't exist (#2366)
Browse files Browse the repository at this point in the history
* Don't load DuskServiceProvider if dusk doesn't exist

When running tests without dusk install this triggers an error

* Add second check

* Bail early instead of wrapping

* Debug CI tests

* Update src/DuskServiceProvider.php

* Update src/DuskServiceProvider.php

---------

Co-authored-by: Quentin Renard <[email protected]>
  • Loading branch information
Tofandel and ifox authored Jan 18, 2024
1 parent ff762bf commit a80cb19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/DuskServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class DuskServiceProvider extends ServiceProvider
{
public function boot(): void
{
if (!class_exists(Browser::class)) {
return;
}
Browser::macro('setBrowserLocationToParis', function () {
$this->setLocationToLatLon(48.864716, 2.349014, 'Europe/Paris');
});
Expand Down

0 comments on commit a80cb19

Please sign in to comment.