diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 19110ec88..620765d19 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -64,14 +64,24 @@ public function handle() $contents = file_get_contents(base_path('tests/Pest.php')); - $contents = str_replace('in('Browser'); - EOT, $contents); + if (str_contains($contents, 'uses(')) { + $contents = str_replace('in('Browser'); + EOT, $contents); + } else { + $contents = str_replace('extend(Tests\DuskTestCase::class) + // ->use(Illuminate\Foundation\Testing\DatabaseMigrations::class) + ->in('Browser'); + EOT, $contents); + } file_put_contents(base_path('tests/Pest.php'), $contents); } else {