From 5bff1e8dd87ec653a2202475377152e5d14fde40 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Fri, 4 Oct 2024 15:02:20 +0100 Subject: [PATCH] [8.x] Adds Pest 3 support (#1141) * Adds Pest 3 support * Apply fixes from StyleCI * Update InstallCommand.php * Update InstallCommand.php --------- Co-authored-by: StyleCI Bot --- src/Console/InstallCommand.php | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) 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 {