From 87dafc95c4b234fa681d449bccc1caa040ba50f8 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Mon, 9 Sep 2024 14:51:44 +0100 Subject: [PATCH] Uses Pest 3 (#408) * Uses Pest 3 * updates pest file * Fixes trait use * Fixes trait use * Fixes trait --- src/Console/InstallCommand.php | 2 +- stubs/api/pest-tests/Pest.php | 9 ++++----- stubs/default/pest-tests/Pest.php | 9 ++++----- stubs/livewire-common/pest-tests/Pest.php | 9 ++++----- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 869b16f0c..98712258a 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -90,7 +90,7 @@ protected function installTests() $this->removeComposerPackages(['phpunit/phpunit'], true); } - if (! $this->requireComposerPackages(['pestphp/pest:^2.0', 'pestphp/pest-plugin-laravel:^2.0'], true)) { + if (! $this->requireComposerPackages(['pestphp/pest', 'pestphp/pest-plugin-laravel'], true)) { return false; } diff --git a/stubs/api/pest-tests/Pest.php b/stubs/api/pest-tests/Pest.php index e2eb38087..40d096b52 100644 --- a/stubs/api/pest-tests/Pest.php +++ b/stubs/api/pest-tests/Pest.php @@ -1,8 +1,5 @@ in('Feature'); +pest()->extend(Tests\TestCase::class) + ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->in('Feature'); /* |-------------------------------------------------------------------------- diff --git a/stubs/default/pest-tests/Pest.php b/stubs/default/pest-tests/Pest.php index e2eb38087..40d096b52 100644 --- a/stubs/default/pest-tests/Pest.php +++ b/stubs/default/pest-tests/Pest.php @@ -1,8 +1,5 @@ in('Feature'); +pest()->extend(Tests\TestCase::class) + ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->in('Feature'); /* |-------------------------------------------------------------------------- diff --git a/stubs/livewire-common/pest-tests/Pest.php b/stubs/livewire-common/pest-tests/Pest.php index e2eb38087..40d096b52 100644 --- a/stubs/livewire-common/pest-tests/Pest.php +++ b/stubs/livewire-common/pest-tests/Pest.php @@ -1,8 +1,5 @@ in('Feature'); +pest()->extend(Tests\TestCase::class) + ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->in('Feature'); /* |--------------------------------------------------------------------------