Revert "Remove Pest plugin Laravel as it doesn't support L9"

This reverts commit ed10a371ee.
This commit is contained in:
Dan Harrin
2023-07-25 12:29:48 +01:00
parent 0944068e00
commit 7955aacb9a
7 changed files with 107 additions and 29 deletions
+2 -1
View File
@@ -18,7 +18,8 @@
"nunomaduro/larastan": "^2.2",
"nunomaduro/termwind": "^1.0",
"orchestra/testbench": "^7.0|^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest": "^1.0|^2.0",
"pestphp/pest-plugin-laravel": "^1.4.0|^2.0",
"pestphp/pest-plugin-livewire": "^2.1",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
Generated
+70 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "bad651d0ed314703868efe9c7caeaa54",
"content-hash": "cd037d36709ad8ae16369d4d32e9a770",
"packages": [],
"packages-dev": [
{
@@ -4936,6 +4936,75 @@
],
"time": "2023-07-08T12:39:42+00:00"
},
{
"name": "pestphp/pest-plugin-laravel",
"version": "v2.1.0",
"source": {
"type": "git",
"url": "https://github.com/pestphp/pest-plugin-laravel.git",
"reference": "db6295986e3c506dbf37c16ddc64c4a83e96bd75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pestphp/pest-plugin-laravel/zipball/db6295986e3c506dbf37c16ddc64c4a83e96bd75",
"reference": "db6295986e3c506dbf37c16ddc64c4a83e96bd75",
"shasum": ""
},
"require": {
"laravel/framework": "^10.15.0",
"pestphp/pest": "^2.8.3",
"php": "^8.1.0"
},
"require-dev": {
"laravel/dusk": "^7.8.0",
"orchestra/testbench": "^8.5.10",
"pestphp/pest-dev-tools": "^2.12.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Pest\\Laravel\\PestServiceProvider"
]
}
},
"autoload": {
"files": [
"src/Autoload.php"
],
"psr-4": {
"Pest\\Laravel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "The Pest Laravel Plugin",
"keywords": [
"framework",
"laravel",
"pest",
"php",
"test",
"testing",
"unit"
],
"support": {
"source": "https://github.com/pestphp/pest-plugin-laravel/tree/v2.1.0"
},
"funding": [
{
"url": "https://www.paypal.com/paypalme/enunomaduro",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
}
],
"time": "2023-07-18T11:41:02+00:00"
},
{
"name": "pestphp/pest-plugin-livewire",
"version": "v2.1.0",
@@ -5,6 +5,7 @@ use Filament\Tests\Models\Post;
use Filament\Tests\Panels\Fixtures\Resources\PostResource;
use Filament\Tests\Panels\Resources\TestCase;
use Illuminate\Support\Str;
use function Pest\Laravel\assertSoftDeleted;
use function Pest\Livewire\livewire;
uses(TestCase::class);
@@ -75,7 +76,7 @@ it('can delete', function () {
])
->callAction(DeleteAction::class);
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
});
it('can refresh data', function () {
@@ -6,6 +6,7 @@ use Filament\Tests\Models\Post;
use Filament\Tests\Panels\Fixtures\Resources\PostResource;
use Filament\Tests\Panels\Fixtures\Resources\UserResource;
use Filament\Tests\Panels\Resources\TestCase;
use function Pest\Laravel\assertSoftDeleted;
use function Pest\Livewire\livewire;
uses(TestCase::class);
@@ -99,7 +100,7 @@ it('can delete posts', function () {
livewire(PostResource\Pages\ListPosts::class)
->callTableAction(DeleteAction::class, $post);
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
});
it('can bulk delete posts', function () {
@@ -109,6 +110,6 @@ it('can bulk delete posts', function () {
->callTableBulkAction(DeleteBulkAction::class, $posts);
foreach ($posts as $post) {
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
}
});
+2 -1
View File
@@ -5,6 +5,7 @@ use Filament\Tests\Models\Post;
use Filament\Tests\Tables\Fixtures\PostsTable;
use Filament\Tests\Tables\TestCase;
use Illuminate\Support\Str;
use function Pest\Laravel\assertSoftDeleted;
use function Pest\Livewire\livewire;
uses(TestCase::class);
@@ -15,7 +16,7 @@ it('can call action', function () {
livewire(PostsTable::class)
->callTableAction(DeleteAction::class, $post);
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
});
it('can call an action with data', function () {
+2 -1
View File
@@ -5,6 +5,7 @@ use Filament\Tests\Models\Post;
use Filament\Tests\Tables\Fixtures\PostsTable;
use Filament\Tests\Tables\TestCase;
use Illuminate\Support\Str;
use function Pest\Laravel\assertSoftDeleted;
use function Pest\Livewire\livewire;
uses(TestCase::class);
@@ -16,7 +17,7 @@ it('can call bulk action', function () {
->callTableBulkAction(DeleteBulkAction::class, $posts);
foreach ($posts as $post) {
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
}
});
+26 -22
View File
@@ -7,6 +7,10 @@ use Filament\Tables\Filters\TrashedFilter;
use Filament\Tests\Models\Post;
use Filament\Tests\Tables\Fixtures\PostsTable;
use Filament\Tests\Tables\TestCase;
use function Pest\Laravel\assertModelExists;
use function Pest\Laravel\assertModelMissing;
use function Pest\Laravel\assertNotSoftDeleted;
use function Pest\Laravel\assertSoftDeleted;
use function Pest\Livewire\livewire;
uses(TestCase::class);
@@ -33,11 +37,11 @@ it('can delete records that are not already deleted', function () {
$post = Post::factory()->create();
$trashedPost = Post::factory()->trashed()->create();
$this->assertModelExists($post);
$this->assertNotSoftDeleted($post);
assertModelExists($post);
assertNotSoftDeleted($post);
$this->assertModelExists($trashedPost);
$this->assertSoftDeleted($trashedPost);
assertModelExists($trashedPost);
assertSoftDeleted($trashedPost);
livewire(PostsTable::class)
->callTableAction(DeleteAction::class, $post)
@@ -46,21 +50,21 @@ it('can delete records that are not already deleted', function () {
->mountTableAction(DeleteAction::class, $trashedPost)
->assertTableActionNotMounted(DeleteAction::class);
$this->assertSoftDeleted($post);
assertSoftDeleted($post);
$this->assertModelExists($trashedPost);
$this->assertSoftDeleted($trashedPost);
assertModelExists($trashedPost);
assertSoftDeleted($trashedPost);
});
it('can force delete records that are already deleted', function () {
$post = Post::factory()->create();
$trashedPost = Post::factory()->trashed()->create();
$this->assertModelExists($post);
$this->assertNotSoftDeleted($post);
assertModelExists($post);
assertNotSoftDeleted($post);
$this->assertModelExists($trashedPost);
$this->assertSoftDeleted($trashedPost);
assertModelExists($trashedPost);
assertSoftDeleted($trashedPost);
livewire(PostsTable::class)
->assertTableActionHidden(ForceDeleteAction::class, $post)
@@ -69,21 +73,21 @@ it('can force delete records that are already deleted', function () {
->filterTable(TrashedFilter::class, true)
->callTableAction(ForceDeleteAction::class, $trashedPost);
$this->assertModelExists($post);
$this->assertNotSoftDeleted($post);
assertModelExists($post);
assertNotSoftDeleted($post);
$this->assertModelMissing($trashedPost);
assertModelMissing($trashedPost);
});
it('can restore records that are already deleted', function () {
$post = Post::factory()->create();
$trashedPost = Post::factory()->trashed()->create();
$this->assertModelExists($post);
$this->assertNotSoftDeleted($post);
assertModelExists($post);
assertNotSoftDeleted($post);
$this->assertModelExists($trashedPost);
$this->assertSoftDeleted($trashedPost);
assertModelExists($trashedPost);
assertSoftDeleted($trashedPost);
livewire(PostsTable::class)
->assertTableActionHidden(RestoreAction::class, $post)
@@ -92,9 +96,9 @@ it('can restore records that are already deleted', function () {
->filterTable(TrashedFilter::class, true)
->callTableAction(RestoreAction::class, $trashedPost);
$this->assertModelExists($post);
$this->assertNotSoftDeleted($post);
assertModelExists($post);
assertNotSoftDeleted($post);
$this->assertModelExists($trashedPost);
$this->assertNotSoftDeleted($trashedPost);
assertModelExists($trashedPost);
assertNotSoftDeleted($trashedPost);
});