Skip to content

Commit

Permalink
Uses Pest 3 (#408)
Browse files Browse the repository at this point in the history
* Uses Pest 3

* updates pest file

* Fixes trait use

* Fixes trait use

* Fixes trait
  • Loading branch information
nunomaduro authored Sep 9, 2024
1 parent 3731c41 commit 87dafc9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
9 changes: 4 additions & 5 deletions stubs/api/pest-tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

/*
|--------------------------------------------------------------------------
| Test Case
|--------------------------------------------------------------------------
|
| The closure you provide to your test functions is always bound to a specific PHPUnit test
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
| need to change it using the "uses()" function to bind a different classes or traits.
| need to change it using the "pest()" function to bind a different classes or traits.
|
*/

uses(TestCase::class, RefreshDatabase::class)->in('Feature');
pest()->extend(Tests\TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
->in('Feature');

/*
|--------------------------------------------------------------------------
Expand Down
9 changes: 4 additions & 5 deletions stubs/default/pest-tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

/*
|--------------------------------------------------------------------------
| Test Case
|--------------------------------------------------------------------------
|
| The closure you provide to your test functions is always bound to a specific PHPUnit test
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
| need to change it using the "uses()" function to bind a different classes or traits.
| need to change it using the "pest()" function to bind a different classes or traits.
|
*/

uses(TestCase::class, RefreshDatabase::class)->in('Feature');
pest()->extend(Tests\TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
->in('Feature');

/*
|--------------------------------------------------------------------------
Expand Down
9 changes: 4 additions & 5 deletions stubs/livewire-common/pest-tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

/*
|--------------------------------------------------------------------------
| Test Case
|--------------------------------------------------------------------------
|
| The closure you provide to your test functions is always bound to a specific PHPUnit test
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
| need to change it using the "uses()" function to bind a different classes or traits.
| need to change it using the "pest()" function to bind a different classes or traits.
|
*/

uses(TestCase::class, RefreshDatabase::class)->in('Feature');
pest()->extend(Tests\TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
->in('Feature');

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 87dafc9

Please sign in to comment.