From ed6662c11f4c80006a04807c13e0e2c16d1f4a18 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Sun, 17 Nov 2024 04:36:03 -0300 Subject: [PATCH] tests: added livewire tests for filament resources & bump dependencies (#759) --- .../Resources/List/External/ExternalEntry.php | 2 + .../ExternalEntry/Pages/EditExternalEntry.php | 31 + .../External/Pages/CreateExternalProfile.php | 16 + .../Resources/List/ExternalProfile.php | 17 +- app/Filament/Resources/Wiki/Anime/Theme.php | 2 +- app/Filament/Resources/Wiki/Audio.php | 31 +- .../CreateExternalProfileTableAction.php | 91 --- composer.json | 78 +-- composer.lock | 547 +++++++++--------- database/factories/Auth/UserFactory.php | 24 + .../List/External/ExternalEntryFactory.php | 2 +- .../Anime/Theme/AnimeThemeEntryFactory.php | 12 + database/factories/Wiki/AnimeFactory.php | 5 +- database/factories/Wiki/ArtistFactory.php | 6 +- .../Wiki/ExternalResourceFactory.php | 6 +- .../External/Entry/ExternalEntryShowTest.php | 1 - tests/Unit/Filament/BaseResourceTest.php | 31 + .../Resources/Admin/AnnouncementTest.php | 124 ++++ .../Filament/Resources/Admin/DumpTest.php | 112 ++++ .../Filament/Resources/Admin/FeatureTest.php | 112 ++++ .../Resources/Admin/FeaturedThemeTest.php | 200 +++++++ .../Resources/Discord/DiscordThreadTest.php | 182 ++++++ .../Filament/Resources/Document/PageTest.php | 200 +++++++ .../List/External/ExternalEntryTest.php | 136 +++++ .../Resources/List/ExternalProfileTest.php | 149 +++++ .../Resources/List/Playlist/TrackTest.php | 156 +++++ .../Filament/Resources/List/PlaylistTest.php | 149 +++++ .../Resources/Wiki/Anime/Theme/EntryTest.php | 214 +++++++ .../Resources/Wiki/Anime/ThemeTest.php | 215 +++++++ .../Filament/Resources/Wiki/AnimeTest.php | 200 +++++++ .../Filament/Resources/Wiki/ArtistTest.php | 200 +++++++ .../Filament/Resources/Wiki/AudioTest.php | 181 ++++++ .../Resources/Wiki/ExternalResourceTest.php | 200 +++++++ .../Filament/Resources/Wiki/GroupTest.php | 200 +++++++ .../Filament/Resources/Wiki/ImageTest.php | 181 ++++++ .../Filament/Resources/Wiki/SeriesTest.php | 200 +++++++ .../Unit/Filament/Resources/Wiki/SongTest.php | 200 +++++++ .../Filament/Resources/Wiki/StudioTest.php | 200 +++++++ .../Resources/Wiki/Video/ScriptTest.php | 181 ++++++ .../Filament/Resources/Wiki/VideoTest.php | 181 ++++++ 40 files changed, 4524 insertions(+), 451 deletions(-) create mode 100644 app/Filament/Resources/List/External/ExternalEntry/Pages/EditExternalEntry.php create mode 100644 app/Filament/Resources/List/External/Pages/CreateExternalProfile.php delete mode 100644 app/Filament/TableActions/Models/List/ExternalProfile/CreateExternalProfileTableAction.php create mode 100644 tests/Unit/Filament/BaseResourceTest.php create mode 100644 tests/Unit/Filament/Resources/Admin/AnnouncementTest.php create mode 100644 tests/Unit/Filament/Resources/Admin/DumpTest.php create mode 100644 tests/Unit/Filament/Resources/Admin/FeatureTest.php create mode 100644 tests/Unit/Filament/Resources/Admin/FeaturedThemeTest.php create mode 100644 tests/Unit/Filament/Resources/Discord/DiscordThreadTest.php create mode 100644 tests/Unit/Filament/Resources/Document/PageTest.php create mode 100644 tests/Unit/Filament/Resources/List/External/ExternalEntryTest.php create mode 100644 tests/Unit/Filament/Resources/List/ExternalProfileTest.php create mode 100644 tests/Unit/Filament/Resources/List/Playlist/TrackTest.php create mode 100644 tests/Unit/Filament/Resources/List/PlaylistTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/Anime/Theme/EntryTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/Anime/ThemeTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/AnimeTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/ArtistTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/AudioTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/ExternalResourceTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/GroupTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/ImageTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/SeriesTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/SongTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/StudioTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/Video/ScriptTest.php create mode 100644 tests/Unit/Filament/Resources/Wiki/VideoTest.php diff --git a/app/Filament/Resources/List/External/ExternalEntry.php b/app/Filament/Resources/List/External/ExternalEntry.php index 17cd9fc74..5f215ac24 100644 --- a/app/Filament/Resources/List/External/ExternalEntry.php +++ b/app/Filament/Resources/List/External/ExternalEntry.php @@ -11,6 +11,7 @@ use App\Filament\Components\Fields\Select; use App\Filament\Components\Infolist\TextEntry; use App\Filament\Resources\BaseResource; +use App\Filament\Resources\List\External\ExternalEntry\Pages\EditExternalEntry; use App\Filament\Resources\List\External\ExternalEntry\Pages\ListExternalEntries; use App\Filament\Resources\List\External\ExternalEntry\Pages\ViewExternalEntry; use App\Filament\Resources\List\External\RelationManagers\ExternalEntryExternalProfileRelationManager; @@ -325,6 +326,7 @@ public static function getPages(): array { return [ 'index' => ListExternalEntries::route('/'), + 'edit' => EditExternalEntry::route('/{record:entry_id}/edit'), 'view' => ViewExternalEntry::route('/{record:entry_id}'), ]; } diff --git a/app/Filament/Resources/List/External/ExternalEntry/Pages/EditExternalEntry.php b/app/Filament/Resources/List/External/ExternalEntry/Pages/EditExternalEntry.php new file mode 100644 index 000000000..d70d602c2 --- /dev/null +++ b/app/Filament/Resources/List/External/ExternalEntry/Pages/EditExternalEntry.php @@ -0,0 +1,31 @@ + ListExternalProfiles::route('/'), + 'create' => CreateExternalProfile::route('/create'), 'view' => ViewExternalProfile::route('/{record:profile_id}'), 'edit' => EditExternalProfile::route('/{record:profile_id}/edit'), ]; diff --git a/app/Filament/Resources/Wiki/Anime/Theme.php b/app/Filament/Resources/Wiki/Anime/Theme.php index 3760e1028..40c2d3645 100644 --- a/app/Filament/Resources/Wiki/Anime/Theme.php +++ b/app/Filament/Resources/Wiki/Anime/Theme.php @@ -373,7 +373,7 @@ public static function infolist(Infolist $infolist): Infolist TextEntry::make(ThemeModel::ATTRIBUTE_ID) ->label(__('filament.fields.anime_theme.slug.name')) - ->formatStateUsing(fn ($state) => ThemeModel::find(intval($state))->getName()), + ->formatStateUsing(fn ($state) => ThemeModel::withTrashed()->find(intval($state))->getName()), TextEntry::make(ThemeModel::RELATION_GROUP . '.' . Group::ATTRIBUTE_NAME) ->label(__('filament.resources.singularLabel.group')) diff --git a/app/Filament/Resources/Wiki/Audio.php b/app/Filament/Resources/Wiki/Audio.php index c49f5c8c6..e3c1163b1 100644 --- a/app/Filament/Resources/Wiki/Audio.php +++ b/app/Filament/Resources/Wiki/Audio.php @@ -121,30 +121,7 @@ public static function getRecordTitleAttribute(): string */ public static function form(Form $form): Form { - return $form - ->schema([ - TextInput::make(AudioModel::ATTRIBUTE_BASENAME) - ->label(__('filament.fields.audio.basename.name')) - ->hiddenOn(['create', 'edit']), - - TextInput::make(AudioModel::ATTRIBUTE_FILENAME) - ->label(__('filament.fields.audio.filename.name')) - ->hiddenOn(['create', 'edit']), - - TextInput::make(AudioModel::ATTRIBUTE_PATH) - ->label(__('filament.fields.audio.path.name')) - ->hiddenOn(['create', 'edit']), - - TextInput::make(AudioModel::ATTRIBUTE_SIZE) - ->label(__('filament.fields.audio.size.name')) - ->numeric() - ->hiddenOn(['create', 'edit']), - - TextInput::make(AudioModel::ATTRIBUTE_MIMETYPE) - ->label(__('filament.fields.audio.mimetype.name')) - ->hiddenOn(['create', 'edit']), - ]) - ->columns(1); + return $form; } /** @@ -162,7 +139,7 @@ public static function table(Table $table): Table TextColumn::make(AudioModel::ATTRIBUTE_ID) ->label(__('filament.fields.base.id')) ->sortable(), - + TextColumn::make(AudioModel::ATTRIBUTE_FILENAME) ->label(__('filament.fields.audio.filename.name')) ->sortable() @@ -261,7 +238,7 @@ public static function getActions(): array [ ActionGroup::make([ MoveAudioAction::make('move-audio'), - + DeleteAudioAction::make('delete-audio'), AttachAudioToRelatedVideosAction::make('attach-audio-related-video'), @@ -300,7 +277,7 @@ public static function getTableActions(): array return [ ActionGroup::make([ UploadAudioTableAction::make('upload-audio'), - + ReconcileAudioTableAction::make('reconcile-audio'), ]), ]; diff --git a/app/Filament/TableActions/Models/List/ExternalProfile/CreateExternalProfileTableAction.php b/app/Filament/TableActions/Models/List/ExternalProfile/CreateExternalProfileTableAction.php deleted file mode 100644 index e31ff515d..000000000 --- a/app/Filament/TableActions/Models/List/ExternalProfile/CreateExternalProfileTableAction.php +++ /dev/null @@ -1,91 +0,0 @@ -label(__('filament.actions.models.list.external_profile.create.name')); - - $this->authorize('create', ExternalProfile::class); - } - - /** - * Perform the action on the table. - * - * @param array $fields - * @return void - */ - public function handle(array $fields): void - { - $name = Arr::get($fields, ExternalProfile::ATTRIBUTE_NAME); - $site = Arr::get($fields, ExternalProfile::ATTRIBUTE_SITE); - $visibility = Arr::get($fields, ExternalProfile::ATTRIBUTE_VISIBILITY); - - $action = new StoreExternalProfileUsernameAction(); - - $action->findOrCreate(ExternalProfile::query(), [ - ExternalProfile::ATTRIBUTE_USER => Filament::auth()->id(), - ExternalProfile::ATTRIBUTE_NAME => $name, - ExternalProfile::ATTRIBUTE_SITE => ExternalProfileSite::from(intval($site))->localize(), - ExternalProfile::ATTRIBUTE_VISIBILITY => ExternalProfileVisibility::from(intval($visibility))->localize(), - ]); - } - - /** - * Get the fields available on the action. - * - * @param Form $form - * @return Form - */ - public function getForm(Form $form): Form - { - return $form - ->schema([ - TextInput::make(ExternalProfile::ATTRIBUTE_NAME) - ->label(__('filament.fields.external_profile.name.name')) - ->helperText(__('filament.fields.external_profile.name.help')) - ->required() - ->rules(['required']), - - Select::make(ExternalProfile::ATTRIBUTE_SITE) - ->label(__('filament.fields.external_profile.site.name')) - ->helperText(__('filament.fields.external_profile.site.help')) - ->options(ExternalProfileSite::asSelectArray()) - ->required() - ->rules(['required', new Enum(ExternalProfileSite::class)]), - - Select::make(ExternalProfile::ATTRIBUTE_VISIBILITY) - ->label(__('filament.fields.external_profile.visibility.name')) - ->helperText(__('filament.fields.external_profile.visibility.help')) - ->options(ExternalProfileVisibility::asSelectArray()) - ->required() - ->rules(['required', new Enum(ExternalProfileVisibility::class)]), - ]); - } -} diff --git a/composer.json b/composer.json index c4d98bd9e..40900d5e4 100644 --- a/composer.json +++ b/composer.json @@ -24,49 +24,49 @@ "ext-gd": "*", "ext-intl": "*", "ext-pdo": "*", - "awcodes/recently": "^1.0", - "babenkoivan/elastic-migrations": "^3.3", - "babenkoivan/elastic-scout-driver-plus": "^4.3", - "bepsvpt/secure-headers": "^7.4", - "bezhansalleh/filament-exceptions": "^2.1", - "cyrildewit/eloquent-viewable": "^7.0", - "fakerphp/faker": "^1.21", - "filament/filament": "^3.2.115", - "filament/forms": "^3.2.115", - "flowframe/laravel-trend": "*", - "guzzlehttp/guzzle": "^7.5", - "laravel-notification-channels/discord": "^1.4", - "laravel/fortify": "^1.16", - "laravel/framework": "^11.21", - "laravel/horizon": "^5.12", - "laravel/pennant": "^1.2", - "laravel/pulse": "^1.2", - "laravel/sanctum": "^4.0", - "laravel/scout": "^10.0", - "laravel/tinker": "^2.8", - "league/flysystem-aws-s3-v3": "^3.0", - "leandrocfe/filament-apex-charts": "^3.1", + "awcodes/recently": "^1.0.6", + "babenkoivan/elastic-migrations": "^3.4.1", + "babenkoivan/elastic-scout-driver-plus": "^4.8", + "bepsvpt/secure-headers": "^7.5", + "bezhansalleh/filament-exceptions": "^2.1.2", + "cyrildewit/eloquent-viewable": "^7.0.3", + "fakerphp/faker": "^1.24", + "filament/filament": "^3.2.124", + "filament/forms": "^3.2.124", + "flowframe/laravel-trend": ">=0.3", + "guzzlehttp/guzzle": "^7.9.2", + "laravel-notification-channels/discord": "^1.6", + "laravel/fortify": "^1.24.5", + "laravel/framework": "^11.32", + "laravel/horizon": "^5.29.3", + "laravel/pennant": "^1.13", + "laravel/pulse": "^1.2.6", + "laravel/sanctum": "^4.0.3", + "laravel/scout": "^10.11.7", + "laravel/tinker": "^2.10", + "league/flysystem-aws-s3-v3": "^3.29", + "leandrocfe/filament-apex-charts": "^3.1.4", "malzariey/filament-daterangepicker-filter": "2.7", - "propaganistas/laravel-disposable-email": "^2.2", - "spatie/db-dumper": "^3.1.1", - "spatie/laravel-permission": "^6.0", - "staudenmeir/belongs-to-through": "^2.13", - "staudenmeir/laravel-adjacency-list": "^1.13", - "symfony/http-client": "^6.0", - "symfony/mailgun-mailer": "^6.0", + "propaganistas/laravel-disposable-email": "^2.4.7", + "spatie/db-dumper": "^3.7.0", + "spatie/laravel-permission": "^6.10.1", + "staudenmeir/belongs-to-through": "^2.16.2", + "staudenmeir/laravel-adjacency-list": "^1.23.1", + "symfony/http-client": "^6.4.15", + "symfony/mailgun-mailer": "^6.4.13", "vinkla/hashids": "^12.0" }, "require-dev": { - "barryvdh/laravel-debugbar": "^3.14", - "brianium/paratest": "^7.0", - "larastan/larastan": "^2.9", - "laravel/pint": "^1.6", - "laravel/sail": "^1.28", - "mockery/mockery": "^1.5.1", - "nunomaduro/collision": "^8.1", - "phpunit/phpunit": "^10.1", - "predis/predis": "^2.0", - "spatie/laravel-ignition": "^2.0" + "barryvdh/laravel-debugbar": "^3.14.7", + "brianium/paratest": "^7.4.8", + "larastan/larastan": "^2.9.11", + "laravel/pint": "^1.18.1", + "laravel/sail": "^1.38", + "mockery/mockery": "^1.6.12", + "nunomaduro/collision": "^8.5", + "phpunit/phpunit": "^10.5.38", + "predis/predis": "^2.2.2", + "spatie/laravel-ignition": "^2.8" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index 5175473d7..cd635857b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "32749e44ea1df6549efc3016d5697e5d", + "content-hash": "993d753f87eac9affe4117d4424730e8", "packages": [ { "name": "anourvalar/eloquent-serialize", - "version": "1.2.25", + "version": "1.2.26", "source": { "type": "git", "url": "https://github.com/AnourValar/eloquent-serialize.git", - "reference": "6d7a868ae4218b9d7796334ff9a17e1539bad48a" + "reference": "756c1232ff0d02321fd90f4fe3c221d6a7b8d697" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/6d7a868ae4218b9d7796334ff9a17e1539bad48a", - "reference": "6d7a868ae4218b9d7796334ff9a17e1539bad48a", + "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/756c1232ff0d02321fd90f4fe3c221d6a7b8d697", + "reference": "756c1232ff0d02321fd90f4fe3c221d6a7b8d697", "shasum": "" }, "require": { @@ -68,22 +68,22 @@ ], "support": { "issues": "https://github.com/AnourValar/eloquent-serialize/issues", - "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.25" + "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.26" }, - "time": "2024-09-16T12:59:37+00:00" + "time": "2024-11-16T12:29:47+00:00" }, { "name": "awcodes/recently", - "version": "v1.0.5", + "version": "v1.0.6", "source": { "type": "git", "url": "https://github.com/awcodes/recently.git", - "reference": "a4fd37b50ab0c4a4bc61983e36de6520f498e696" + "reference": "4aada0ffb8580b97de254b47ee2723a206dc856f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/awcodes/recently/zipball/a4fd37b50ab0c4a4bc61983e36de6520f498e696", - "reference": "a4fd37b50ab0c4a4bc61983e36de6520f498e696", + "url": "https://api.github.com/repos/awcodes/recently/zipball/4aada0ffb8580b97de254b47ee2723a206dc856f", + "reference": "4aada0ffb8580b97de254b47ee2723a206dc856f", "shasum": "" }, "require": { @@ -145,20 +145,20 @@ "type": "github" } ], - "time": "2024-10-21T12:58:56+00:00" + "time": "2024-10-25T19:22:52+00:00" }, { "name": "aws/aws-crt-php", - "version": "v1.2.6", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/awslabs/aws-crt-php.git", - "reference": "a63485b65b6b3367039306496d49737cf1995408" + "reference": "d71d9906c7bb63a28295447ba12e74723bd3730e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/a63485b65b6b3367039306496d49737cf1995408", - "reference": "a63485b65b6b3367039306496d49737cf1995408", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/d71d9906c7bb63a28295447ba12e74723bd3730e", + "reference": "d71d9906c7bb63a28295447ba12e74723bd3730e", "shasum": "" }, "require": { @@ -197,22 +197,22 @@ ], "support": { "issues": "https://github.com/awslabs/aws-crt-php/issues", - "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.6" + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.7" }, - "time": "2024-06-13T17:21:28+00:00" + "time": "2024-10-18T22:15:13+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.324.7", + "version": "3.328.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "c430d00e5ea6ce23739d6345f073fdd39e8ef0dc" + "reference": "a99b58e166ae367f2b067937afb04e843e900745" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c430d00e5ea6ce23739d6345f073fdd39e8ef0dc", - "reference": "c430d00e5ea6ce23739d6345f073fdd39e8ef0dc", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a99b58e166ae367f2b067937afb04e843e900745", + "reference": "a99b58e166ae367f2b067937afb04e843e900745", "shasum": "" }, "require": { @@ -295,9 +295,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.324.7" + "source": "https://github.com/aws/aws-sdk-php/tree/3.328.0" }, - "time": "2024-10-21T18:06:52+00:00" + "time": "2024-11-15T19:06:57+00:00" }, { "name": "babenkoivan/elastic-adapter", @@ -795,16 +795,16 @@ }, { "name": "bezhansalleh/filament-exceptions", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/bezhanSalleh/filament-exceptions.git", - "reference": "14a9be86fbb88087f2ae9167289d1fbcf0024db2" + "reference": "6450b6b9f02ed40e5e140ddf97ae5961c5919620" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bezhanSalleh/filament-exceptions/zipball/14a9be86fbb88087f2ae9167289d1fbcf0024db2", - "reference": "14a9be86fbb88087f2ae9167289d1fbcf0024db2", + "url": "https://api.github.com/repos/bezhanSalleh/filament-exceptions/zipball/6450b6b9f02ed40e5e140ddf97ae5961c5919620", + "reference": "6450b6b9f02ed40e5e140ddf97ae5961c5919620", "shasum": "" }, "require": { @@ -860,7 +860,7 @@ ], "support": { "issues": "https://github.com/bezhanSalleh/filament-exceptions/issues", - "source": "https://github.com/bezhanSalleh/filament-exceptions/tree/2.1.1" + "source": "https://github.com/bezhanSalleh/filament-exceptions/tree/2.1.2" }, "funding": [ { @@ -868,7 +868,7 @@ "type": "github" } ], - "time": "2024-01-25T16:42:20+00:00" + "time": "2024-11-06T07:08:53+00:00" }, { "name": "blade-ui-kit/blade-heroicons", @@ -2028,16 +2028,16 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v8.15.0", + "version": "v8.16.0", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "34c2444fa8d4c3e6c8b009bd8dea90bca007203b" + "reference": "ab0fdb43f9e69f0d0539028d8b0b56cdf3328d85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/34c2444fa8d4c3e6c8b009bd8dea90bca007203b", - "reference": "34c2444fa8d4c3e6c8b009bd8dea90bca007203b", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/ab0fdb43f9e69f0d0539028d8b0b56cdf3328d85", + "reference": "ab0fdb43f9e69f0d0539028d8b0b56cdf3328d85", "shasum": "" }, "require": { @@ -2080,22 +2080,22 @@ ], "support": { "issues": "https://github.com/elastic/elasticsearch-php/issues", - "source": "https://github.com/elastic/elasticsearch-php/tree/v8.15.0" + "source": "https://github.com/elastic/elasticsearch-php/tree/v8.16.0" }, - "time": "2024-08-14T14:32:50+00:00" + "time": "2024-11-14T22:23:33+00:00" }, { "name": "fakerphp/faker", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" + "reference": "a136842a532bac9ecd8a1c723852b09915d7db50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", - "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/a136842a532bac9ecd8a1c723852b09915d7db50", + "reference": "a136842a532bac9ecd8a1c723852b09915d7db50", "shasum": "" }, "require": { @@ -2143,22 +2143,22 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.0" }, - "time": "2024-01-02T13:46:09+00:00" + "time": "2024-11-07T15:11:20+00:00" }, { "name": "filament/actions", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "de0a2c9d453ceb6546b1a804a8240d0b8367b1ce" + "reference": "631b38a36f5209a3884182acee60a0db682c6d24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/de0a2c9d453ceb6546b1a804a8240d0b8367b1ce", - "reference": "de0a2c9d453ceb6546b1a804a8240d0b8367b1ce", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/631b38a36f5209a3884182acee60a0db682c6d24", + "reference": "631b38a36f5209a3884182acee60a0db682c6d24", "shasum": "" }, "require": { @@ -2198,20 +2198,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-11-06T08:50:46+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/filament", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "5c4bf4225106e5d2a1348de4e717a1ef8432b332" + "reference": "3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/5c4bf4225106e5d2a1348de4e717a1ef8432b332", - "reference": "5c4bf4225106e5d2a1348de4e717a1ef8432b332", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9", + "reference": "3f170b1c57033ad8e9e6bd71f3dc3f0665bf3ae9", "shasum": "" }, "require": { @@ -2263,20 +2263,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-11-06T08:50:55+00:00" + "time": "2024-11-13T16:35:35+00:00" }, { "name": "filament/forms", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "f75386dc6f3c41fd3178265a71806f1ed4be0478" + "reference": "c73351c086036bd8de24e8671fd97018942d6d61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/f75386dc6f3c41fd3178265a71806f1ed4be0478", - "reference": "f75386dc6f3c41fd3178265a71806f1ed4be0478", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/c73351c086036bd8de24e8671fd97018942d6d61", + "reference": "c73351c086036bd8de24e8671fd97018942d6d61", "shasum": "" }, "require": { @@ -2319,20 +2319,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-11-06T08:50:57+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/infolists", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "2d934d4d7f420fc1165ced33df0959a656163a0c" + "reference": "7946035f47746e69ff9d98bfed04b0248000ee2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/2d934d4d7f420fc1165ced33df0959a656163a0c", - "reference": "2d934d4d7f420fc1165ced33df0959a656163a0c", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/7946035f47746e69ff9d98bfed04b0248000ee2e", + "reference": "7946035f47746e69ff9d98bfed04b0248000ee2e", "shasum": "" }, "require": { @@ -2370,11 +2370,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-24T13:47:00+00:00" + "time": "2024-11-13T16:35:31+00:00" }, { "name": "filament/notifications", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", @@ -2426,16 +2426,16 @@ }, { "name": "filament/support", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32" + "reference": "13b1e485d3bc993950c9e61a3f6a8cb05efd2b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32", - "reference": "e7174cee7e1d08205f7120d0dcc0d00d9bdd4d32", + "url": "https://api.github.com/repos/filamentphp/support/zipball/13b1e485d3bc993950c9e61a3f6a8cb05efd2b96", + "reference": "13b1e485d3bc993950c9e61a3f6a8cb05efd2b96", "shasum": "" }, "require": { @@ -2481,20 +2481,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-31T13:38:25+00:00" + "time": "2024-11-13T16:35:51+00:00" }, { "name": "filament/tables", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "d066eed11528f1928a76cbe9075c54ddfe26fd1e" + "reference": "5f1b04952080e71f3f72bae3801f2757619722e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/d066eed11528f1928a76cbe9075c54ddfe26fd1e", - "reference": "d066eed11528f1928a76cbe9075c54ddfe26fd1e", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/5f1b04952080e71f3f72bae3801f2757619722e7", + "reference": "5f1b04952080e71f3f72bae3801f2757619722e7", "shasum": "" }, "require": { @@ -2533,20 +2533,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-11-06T08:51:06+00:00" + "time": "2024-11-13T16:35:47+00:00" }, { "name": "filament/widgets", - "version": "v3.2.123", + "version": "v3.2.124", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "14ae503aae8265ddc48274debbf7b7aefc7afb0b" + "reference": "59a907af93c9027180e2bac5879f35b5fb11c96f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/14ae503aae8265ddc48274debbf7b7aefc7afb0b", - "reference": "14ae503aae8265ddc48274debbf7b7aefc7afb0b", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/59a907af93c9027180e2bac5879f35b5fb11c96f", + "reference": "59a907af93c9027180e2bac5879f35b5fb11c96f", "shasum": "" }, "require": { @@ -2577,7 +2577,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-10-08T14:24:26+00:00" + "time": "2024-11-13T16:35:48+00:00" }, { "name": "flowframe/laravel-trend", @@ -3338,16 +3338,16 @@ }, { "name": "jaybizzle/crawler-detect", - "version": "v1.2.120", + "version": "v1.2.121", "source": { "type": "git", "url": "https://github.com/JayBizzle/Crawler-Detect.git", - "reference": "2b325bdce46bbb8a2e96dc740ad37c743c9d8617" + "reference": "40ecda6322d4163fe2c6e1dd47c574f580b8487f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/2b325bdce46bbb8a2e96dc740ad37c743c9d8617", - "reference": "2b325bdce46bbb8a2e96dc740ad37c743c9d8617", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/40ecda6322d4163fe2c6e1dd47c574f580b8487f", + "reference": "40ecda6322d4163fe2c6e1dd47c574f580b8487f", "shasum": "" }, "require": { @@ -3384,9 +3384,9 @@ ], "support": { "issues": "https://github.com/JayBizzle/Crawler-Detect/issues", - "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.120" + "source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.2.121" }, - "time": "2024-09-15T14:31:21+00:00" + "time": "2024-10-20T21:42:39+00:00" }, { "name": "kirschbaum-development/eloquent-power-joins", @@ -3521,16 +3521,16 @@ }, { "name": "laravel/fortify", - "version": "v1.24.2", + "version": "v1.24.5", "source": { "type": "git", "url": "https://github.com/laravel/fortify.git", - "reference": "42695c45087e5abb3e173725b4f1ef4956a7b47d" + "reference": "bba8c2ecc3fcc78e8632e0d719ae10bef6343eef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/fortify/zipball/42695c45087e5abb3e173725b4f1ef4956a7b47d", - "reference": "42695c45087e5abb3e173725b4f1ef4956a7b47d", + "url": "https://api.github.com/repos/laravel/fortify/zipball/bba8c2ecc3fcc78e8632e0d719ae10bef6343eef", + "reference": "bba8c2ecc3fcc78e8632e0d719ae10bef6343eef", "shasum": "" }, "require": { @@ -3582,20 +3582,20 @@ "issues": "https://github.com/laravel/fortify/issues", "source": "https://github.com/laravel/fortify" }, - "time": "2024-09-16T19:20:52+00:00" + "time": "2024-11-12T14:51:12+00:00" }, { "name": "laravel/framework", - "version": "v11.30.0", + "version": "v11.32.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "dff716442d9c229d716be82ccc9a7de52eb97193" + "reference": "bc2aad63f83ee5089be7b21cf29d645ccf31e927" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/dff716442d9c229d716be82ccc9a7de52eb97193", - "reference": "dff716442d9c229d716be82ccc9a7de52eb97193", + "url": "https://api.github.com/repos/laravel/framework/zipball/bc2aad63f83ee5089be7b21cf29d645ccf31e927", + "reference": "bc2aad63f83ee5089be7b21cf29d645ccf31e927", "shasum": "" }, "require": { @@ -3791,20 +3791,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-10-30T15:00:34+00:00" + "time": "2024-11-15T17:04:33+00:00" }, { "name": "laravel/horizon", - "version": "v5.29.1", + "version": "v5.29.3", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "9f482f21c23ed01c2366d1157843165165579c23" + "reference": "a48d242759704e598242074daf0060bbeb6ed46d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/9f482f21c23ed01c2366d1157843165165579c23", - "reference": "9f482f21c23ed01c2366d1157843165165579c23", + "url": "https://api.github.com/repos/laravel/horizon/zipball/a48d242759704e598242074daf0060bbeb6ed46d", + "reference": "a48d242759704e598242074daf0060bbeb6ed46d", "shasum": "" }, "require": { @@ -3819,6 +3819,7 @@ "ramsey/uuid": "^4.0", "symfony/console": "^6.0|^7.0", "symfony/error-handler": "^6.0|^7.0", + "symfony/polyfill-php83": "^1.28", "symfony/process": "^6.0|^7.0" }, "require-dev": { @@ -3868,22 +3869,22 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.29.1" + "source": "https://github.com/laravel/horizon/tree/v5.29.3" }, - "time": "2024-10-08T18:23:02+00:00" + "time": "2024-11-07T21:51:45+00:00" }, { "name": "laravel/pennant", - "version": "v1.12.0", + "version": "v1.13.0", "source": { "type": "git", "url": "https://github.com/laravel/pennant.git", - "reference": "7d669662519af4502e369723db4b49644f44aefe" + "reference": "1a3a06e39dc2069fda05dd26181645581e8050b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pennant/zipball/7d669662519af4502e369723db4b49644f44aefe", - "reference": "7d669662519af4502e369723db4b49644f44aefe", + "url": "https://api.github.com/repos/laravel/pennant/zipball/1a3a06e39dc2069fda05dd26181645581e8050b4", + "reference": "1a3a06e39dc2069fda05dd26181645581e8050b4", "shasum": "" }, "require": { @@ -3947,20 +3948,20 @@ "issues": "https://github.com/laravel/pennant/issues", "source": "https://github.com/laravel/pennant" }, - "time": "2024-09-30T14:40:37+00:00" + "time": "2024-11-12T14:58:05+00:00" }, { "name": "laravel/prompts", - "version": "v0.3.1", + "version": "v0.3.2", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "0f3848a445562dac376b27968f753c65e7e1036e" + "reference": "0e0535747c6b8d6d10adca8b68293cf4517abb0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/0f3848a445562dac376b27968f753c65e7e1036e", - "reference": "0f3848a445562dac376b27968f753c65e7e1036e", + "url": "https://api.github.com/repos/laravel/prompts/zipball/0e0535747c6b8d6d10adca8b68293cf4517abb0f", + "reference": "0e0535747c6b8d6d10adca8b68293cf4517abb0f", "shasum": "" }, "require": { @@ -3976,7 +3977,7 @@ "require-dev": { "illuminate/collections": "^10.0|^11.0", "mockery/mockery": "^1.5", - "pestphp/pest": "^2.3", + "pestphp/pest": "^2.3|^3.4", "phpstan/phpstan": "^1.11", "phpstan/phpstan-mockery": "^1.1" }, @@ -4004,22 +4005,22 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.1" + "source": "https://github.com/laravel/prompts/tree/v0.3.2" }, - "time": "2024-10-09T19:42:26+00:00" + "time": "2024-11-12T14:59:47+00:00" }, { "name": "laravel/pulse", - "version": "v1.2.5", + "version": "v1.2.6", "source": { "type": "git", "url": "https://github.com/laravel/pulse.git", - "reference": "0c0c91fd05acc537f6324b271709670ffc201e59" + "reference": "6bde670e71155c969d7a9f42ba0e6465291faa0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pulse/zipball/0c0c91fd05acc537f6324b271709670ffc201e59", - "reference": "0c0c91fd05acc537f6324b271709670ffc201e59", + "url": "https://api.github.com/repos/laravel/pulse/zipball/6bde670e71155c969d7a9f42ba0e6465291faa0d", + "reference": "6bde670e71155c969d7a9f42ba0e6465291faa0d", "shasum": "" }, "require": { @@ -4093,7 +4094,7 @@ "issues": "https://github.com/laravel/pulse/issues", "source": "https://github.com/laravel/pulse" }, - "time": "2024-09-03T09:21:52+00:00" + "time": "2024-11-12T14:57:16+00:00" }, { "name": "laravel/sanctum", @@ -4161,16 +4162,16 @@ }, { "name": "laravel/scout", - "version": "v10.11.4", + "version": "v10.11.7", "source": { "type": "git", "url": "https://github.com/laravel/scout.git", - "reference": "f9cf4f79163e3c5f13f81369d4992d66e6700502" + "reference": "d4c0bbc41f52b4bf315914cfc7046fd485e8d92d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/scout/zipball/f9cf4f79163e3c5f13f81369d4992d66e6700502", - "reference": "f9cf4f79163e3c5f13f81369d4992d66e6700502", + "url": "https://api.github.com/repos/laravel/scout/zipball/d4c0bbc41f52b4bf315914cfc7046fd485e8d92d", + "reference": "d4c0bbc41f52b4bf315914cfc7046fd485e8d92d", "shasum": "" }, "require": { @@ -4184,8 +4185,11 @@ "php": "^8.0", "symfony/console": "^6.0|^7.0" }, + "conflict": { + "algolia/algoliasearch-client-php": "<3.2.0|>=5.0.0" + }, "require-dev": { - "algolia/algoliasearch-client-php": "^3.2", + "algolia/algoliasearch-client-php": "^3.2|^4.0", "meilisearch/meilisearch-php": "^1.0", "mockery/mockery": "^1.0", "orchestra/testbench": "^7.31|^8.11|^9.0", @@ -4235,20 +4239,20 @@ "issues": "https://github.com/laravel/scout/issues", "source": "https://github.com/laravel/scout" }, - "time": "2024-10-01T14:39:33+00:00" + "time": "2024-11-13T09:41:16+00:00" }, { "name": "laravel/serializable-closure", - "version": "v1.3.5", + "version": "v1.3.6", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c" + "reference": "f865a58ea3a0107c336b7045104c75243fa59d96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c", - "reference": "1dc4a3dbfa2b7628a3114e43e32120cce7cdda9c", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f865a58ea3a0107c336b7045104c75243fa59d96", + "reference": "f865a58ea3a0107c336b7045104c75243fa59d96", "shasum": "" }, "require": { @@ -4296,7 +4300,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2024-09-23T13:33:08+00:00" + "time": "2024-11-11T17:06:04+00:00" }, { "name": "laravel/tinker", @@ -5342,16 +5346,16 @@ }, { "name": "monolog/monolog", - "version": "3.7.0", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8" + "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f4393b648b78a5408747de94fca38beb5f7e9ef8", - "reference": "f4393b648b78a5408747de94fca38beb5f7e9ef8", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/32e515fdc02cdafbe4593e30a9350d486b125b67", + "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67", "shasum": "" }, "require": { @@ -5371,12 +5375,14 @@ "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "^10.5.17", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", - "ruflin/elastica": "^7", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", "symfony/mime": "^5.4 || ^6" }, @@ -5427,7 +5433,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.7.0" + "source": "https://github.com/Seldaek/monolog/tree/3.8.0" }, "funding": [ { @@ -5439,7 +5445,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:40:51+00:00" + "time": "2024-11-12T13:57:08+00:00" }, { "name": "mtdowling/jmespath.php", @@ -6512,16 +6518,16 @@ }, { "name": "propaganistas/laravel-disposable-email", - "version": "2.4.6", + "version": "2.4.7", "source": { "type": "git", "url": "https://github.com/Propaganistas/Laravel-Disposable-Email.git", - "reference": "378e9d3b049b7b12e0b1e656c1d82c504173d8b2" + "reference": "3ce8c2d70d65e4b749818a5766d7f59d1ee0d5ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Propaganistas/Laravel-Disposable-Email/zipball/378e9d3b049b7b12e0b1e656c1d82c504173d8b2", - "reference": "378e9d3b049b7b12e0b1e656c1d82c504173d8b2", + "url": "https://api.github.com/repos/Propaganistas/Laravel-Disposable-Email/zipball/3ce8c2d70d65e4b749818a5766d7f59d1ee0d5ce", + "reference": "3ce8c2d70d65e4b749818a5766d7f59d1ee0d5ce", "shasum": "" }, "require": { @@ -6577,7 +6583,7 @@ ], "support": { "issues": "https://github.com/Propaganistas/Laravel-Disposable-Email/issues", - "source": "https://github.com/Propaganistas/Laravel-Disposable-Email/tree/2.4.6" + "source": "https://github.com/Propaganistas/Laravel-Disposable-Email/tree/2.4.7" }, "funding": [ { @@ -6585,7 +6591,7 @@ "type": "github" } ], - "time": "2024-10-01T00:48:13+00:00" + "time": "2024-11-01T00:48:20+00:00" }, { "name": "psr/cache", @@ -8053,16 +8059,16 @@ }, { "name": "spatie/laravel-permission", - "version": "6.9.0", + "version": "6.10.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-permission.git", - "reference": "fe973a58b44380d0e8620107259b7bda22f70408" + "reference": "8bb69d6d67387f7a00d93a2f5fab98860f06e704" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/fe973a58b44380d0e8620107259b7bda22f70408", - "reference": "fe973a58b44380d0e8620107259b7bda22f70408", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/8bb69d6d67387f7a00d93a2f5fab98860f06e704", + "reference": "8bb69d6d67387f7a00d93a2f5fab98860f06e704", "shasum": "" }, "require": { @@ -8073,6 +8079,7 @@ "php": "^8.0" }, "require-dev": { + "larastan/larastan": "^1.0|^2.0", "laravel/passport": "^11.0|^12.0", "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", "phpunit/phpunit": "^9.4|^10.1" @@ -8123,7 +8130,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-permission/issues", - "source": "https://github.com/spatie/laravel-permission/tree/6.9.0" + "source": "https://github.com/spatie/laravel-permission/tree/6.10.1" }, "funding": [ { @@ -8131,20 +8138,20 @@ "type": "github" } ], - "time": "2024-06-22T23:04:52+00:00" + "time": "2024-11-08T18:45:41+00:00" }, { "name": "staudenmeir/belongs-to-through", - "version": "v2.16.1", + "version": "v2.16.2", "source": { "type": "git", "url": "https://github.com/staudenmeir/belongs-to-through.git", - "reference": "28cbfca503cf0b8b4a80a0382ccfdf7edfe94c27" + "reference": "a5e352df3d26abe34d715c6e192e537927cfb88d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/belongs-to-through/zipball/28cbfca503cf0b8b4a80a0382ccfdf7edfe94c27", - "reference": "28cbfca503cf0b8b4a80a0382ccfdf7edfe94c27", + "url": "https://api.github.com/repos/staudenmeir/belongs-to-through/zipball/a5e352df3d26abe34d715c6e192e537927cfb88d", + "reference": "a5e352df3d26abe34d715c6e192e537927cfb88d", "shasum": "" }, "require": { @@ -8155,9 +8162,6 @@ "barryvdh/laravel-ide-helper": "^3.0", "larastan/larastan": "^2.9", "orchestra/testbench": "^9.0", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.4", "phpunit/phpunit": "^11.0" }, "type": "library", @@ -8191,7 +8195,7 @@ "description": "Laravel Eloquent BelongsToThrough relationships", "support": { "issues": "https://github.com/staudenmeir/belongs-to-through/issues", - "source": "https://github.com/staudenmeir/belongs-to-through/tree/v2.16.1" + "source": "https://github.com/staudenmeir/belongs-to-through/tree/v2.16.2" }, "funding": [ { @@ -8199,7 +8203,7 @@ "type": "custom" } ], - "time": "2024-09-09T12:01:40+00:00" + "time": "2024-11-06T19:48:19+00:00" }, { "name": "staudenmeir/eloquent-has-many-deep-contracts", @@ -8244,16 +8248,16 @@ }, { "name": "staudenmeir/laravel-adjacency-list", - "version": "v1.22.2", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/staudenmeir/laravel-adjacency-list.git", - "reference": "3bdb2b294f678d5f18b25c401b24bfd9b4a5fbab" + "reference": "3c4c0d964e8e4f2669d0917917c87ad61d2f0017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/staudenmeir/laravel-adjacency-list/zipball/3bdb2b294f678d5f18b25c401b24bfd9b4a5fbab", - "reference": "3bdb2b294f678d5f18b25c401b24bfd9b4a5fbab", + "url": "https://api.github.com/repos/staudenmeir/laravel-adjacency-list/zipball/3c4c0d964e8e4f2669d0917917c87ad61d2f0017", + "reference": "3c4c0d964e8e4f2669d0917917c87ad61d2f0017", "shasum": "" }, "require": { @@ -8264,11 +8268,10 @@ }, "require-dev": { "barryvdh/laravel-ide-helper": "^3.0", - "harrygulliford/laravel-firebird": "dev-laravel-11.x", - "larastan/larastan": "^2.0", + "harrygulliford/laravel-firebird": "^3.3", + "larastan/larastan": "2.9.8", "mockery/mockery": "^1.5.1", "orchestra/testbench": "^9.0", - "phpstan/phpstan-mockery": "^1.1", "phpunit/phpunit": "^11.0", "singlestoredb/singlestoredb-laravel": "^1.5.4", "staudenmeir/eloquent-has-many-deep": "^1.20" @@ -8302,7 +8305,7 @@ "description": "Recursive Laravel Eloquent relationships with CTEs", "support": { "issues": "https://github.com/staudenmeir/laravel-adjacency-list/issues", - "source": "https://github.com/staudenmeir/laravel-adjacency-list/tree/v1.22.2" + "source": "https://github.com/staudenmeir/laravel-adjacency-list/tree/v1.23.1" }, "funding": [ { @@ -8310,7 +8313,7 @@ "type": "custom" } ], - "time": "2024-08-29T16:28:51+00:00" + "time": "2024-11-03T10:47:29+00:00" }, { "name": "staudenmeir/laravel-cte", @@ -8449,16 +8452,16 @@ }, { "name": "symfony/console", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", - "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { @@ -8522,7 +8525,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.7" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -8538,7 +8541,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/css-selector", @@ -9038,16 +9041,16 @@ }, { "name": "symfony/http-client", - "version": "v6.4.14", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "05d88cbd816ad6e0202edd9a9963cb9d615b8826" + "reference": "cb4073c905cd12b8496d24ac428a9228c1750670" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/05d88cbd816ad6e0202edd9a9963cb9d615b8826", - "reference": "05d88cbd816ad6e0202edd9a9963cb9d615b8826", + "url": "https://api.github.com/repos/symfony/http-client/zipball/cb4073c905cd12b8496d24ac428a9228c1750670", + "reference": "cb4073c905cd12b8496d24ac428a9228c1750670", "shasum": "" }, "require": { @@ -9111,7 +9114,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.14" + "source": "https://github.com/symfony/http-client/tree/v6.4.15" }, "funding": [ { @@ -9127,7 +9130,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T16:39:55+00:00" + "time": "2024-11-13T13:40:18+00:00" }, { "name": "symfony/http-client-contracts", @@ -9209,16 +9212,16 @@ }, { "name": "symfony/http-foundation", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "5183b61657807099d98f3367bcccb850238b17a9" + "reference": "f4419ec69ccfc3f725a4de7c20e4e57626d10112" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5183b61657807099d98f3367bcccb850238b17a9", - "reference": "5183b61657807099d98f3367bcccb850238b17a9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f4419ec69ccfc3f725a4de7c20e4e57626d10112", + "reference": "f4419ec69ccfc3f725a4de7c20e4e57626d10112", "shasum": "" }, "require": { @@ -9228,12 +9231,12 @@ }, "conflict": { "doctrine/dbal": "<3.6", - "symfony/cache": "<6.4" + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" }, "require-dev": { "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^6.4|^7.0", + "symfony/cache": "^6.4.12|^7.1.5", "symfony/dependency-injection": "^6.4|^7.0", "symfony/expression-language": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", @@ -9266,7 +9269,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.1.7" + "source": "https://github.com/symfony/http-foundation/tree/v7.1.8" }, "funding": [ { @@ -9282,20 +9285,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:02:46+00:00" + "time": "2024-11-09T09:16:45+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "7f137cda31fd41e422edcdc01915f2c095b84399" + "reference": "33fef24e3dc79d6d30bf4936531f2f4bd2ca189e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/7f137cda31fd41e422edcdc01915f2c095b84399", - "reference": "7f137cda31fd41e422edcdc01915f2c095b84399", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/33fef24e3dc79d6d30bf4936531f2f4bd2ca189e", + "reference": "33fef24e3dc79d6d30bf4936531f2f4bd2ca189e", "shasum": "" }, "require": { @@ -9380,7 +9383,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.1.7" + "source": "https://github.com/symfony/http-kernel/tree/v7.1.8" }, "funding": [ { @@ -9396,7 +9399,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:54:34+00:00" + "time": "2024-11-13T14:25:32+00:00" }, { "name": "symfony/mailer", @@ -9480,16 +9483,16 @@ }, { "name": "symfony/mailgun-mailer", - "version": "v6.4.10", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/mailgun-mailer.git", - "reference": "3eb7c7b644179a766f5d816620b7b6d4a4e7ec43" + "reference": "ad4e79798a5eb80af99004a4871b4fe5effe33a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/3eb7c7b644179a766f5d816620b7b6d4a4e7ec43", - "reference": "3eb7c7b644179a766f5d816620b7b6d4a4e7ec43", + "url": "https://api.github.com/repos/symfony/mailgun-mailer/zipball/ad4e79798a5eb80af99004a4871b4fe5effe33a3", + "reference": "ad4e79798a5eb80af99004a4871b4fe5effe33a3", "shasum": "" }, "require": { @@ -9529,7 +9532,7 @@ "description": "Symfony Mailgun Mailer Bridge", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailgun-mailer/tree/v6.4.10" + "source": "https://github.com/symfony/mailgun-mailer/tree/v6.4.13" }, "funding": [ { @@ -9545,7 +9548,7 @@ "type": "tidelift" } ], - "time": "2024-07-04T11:16:22+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/mime", @@ -10345,16 +10348,16 @@ }, { "name": "symfony/process", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", + "url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", + "reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", "shasum": "" }, "require": { @@ -10386,7 +10389,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.7" + "source": "https://github.com/symfony/process/tree/v7.1.8" }, "funding": [ { @@ -10402,7 +10405,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:12+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/routing", @@ -10570,16 +10573,16 @@ }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { @@ -10637,7 +10640,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -10653,7 +10656,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "symfony/translation", @@ -10903,16 +10906,16 @@ }, { "name": "symfony/var-dumper", - "version": "v7.1.7", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f6ea51f669760cacd7464bf7eaa0be87b8072db1" + "reference": "7bb01a47b1b00428d32b5e7b4d3b2d1aa58d3db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f6ea51f669760cacd7464bf7eaa0be87b8072db1", - "reference": "f6ea51f669760cacd7464bf7eaa0be87b8072db1", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7bb01a47b1b00428d32b5e7b4d3b2d1aa58d3db8", + "reference": "7bb01a47b1b00428d32b5e7b4d3b2d1aa58d3db8", "shasum": "" }, "require": { @@ -10966,7 +10969,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.1.7" + "source": "https://github.com/symfony/var-dumper/tree/v7.1.8" }, "funding": [ { @@ -10982,7 +10985,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:55+00:00" + "time": "2024-11-08T15:46:42+00:00" }, { "name": "textalk/websocket", @@ -11373,16 +11376,16 @@ "packages-dev": [ { "name": "barryvdh/laravel-debugbar", - "version": "v3.14.6", + "version": "v3.14.7", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "14e4517bd49130d6119228107eb21ae47ae120ab" + "reference": "f484b8c9124de0b163da39958331098ffcd4a65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/14e4517bd49130d6119228107eb21ae47ae120ab", - "reference": "14e4517bd49130d6119228107eb21ae47ae120ab", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/f484b8c9124de0b163da39958331098ffcd4a65e", + "reference": "f484b8c9124de0b163da39958331098ffcd4a65e", "shasum": "" }, "require": { @@ -11441,7 +11444,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.14.6" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.14.7" }, "funding": [ { @@ -11453,7 +11456,7 @@ "type": "github" } ], - "time": "2024-10-18T13:15:12+00:00" + "time": "2024-11-14T09:12:35+00:00" }, { "name": "brianium/paratest", @@ -11792,16 +11795,16 @@ }, { "name": "larastan/larastan", - "version": "v2.9.9", + "version": "v2.9.11", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2" + "reference": "54eccd35d1732b9ee4392c25aec606a6a9c521e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/148faa138f0d8acb7d85f4a55693d3e13b6048d2", - "reference": "148faa138f0d8acb7d85f4a55693d3e13b6048d2", + "url": "https://api.github.com/repos/larastan/larastan/zipball/54eccd35d1732b9ee4392c25aec606a6a9c521e7", + "reference": "54eccd35d1732b9ee4392c25aec606a6a9c521e7", "shasum": "" }, "require": { @@ -11819,9 +11822,11 @@ }, "require-dev": { "doctrine/coding-standard": "^12.0", + "laravel/framework": "^9.52.16 || ^10.28.0 || ^11.16", + "mockery/mockery": "^1.5.1", "nikic/php-parser": "^4.19.1", "orchestra/canvas": "^7.11.1 || ^8.11.0 || ^9.0.2", - "orchestra/testbench": "^7.33.0 || ^8.13.0 || ^9.0.3", + "orchestra/testbench-core": "^7.33.0 || ^8.13.0 || ^9.0.9", "phpstan/phpstan-deprecation-rules": "^1.2", "phpunit/phpunit": "^9.6.13 || ^10.5.16" }, @@ -11871,7 +11876,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.9.9" + "source": "https://github.com/larastan/larastan/tree/v2.9.11" }, "funding": [ { @@ -11891,7 +11896,7 @@ "type": "patreon" } ], - "time": "2024-10-15T19:41:22+00:00" + "time": "2024-11-11T23:11:00+00:00" }, { "name": "laravel/pint", @@ -11961,16 +11966,16 @@ }, { "name": "laravel/sail", - "version": "v1.36.0", + "version": "v1.38.0", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "f184d3d687155d06bc8cb9ff6dc48596a138460c" + "reference": "d17abae06661dd6c46d13627b1683a2924259145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/f184d3d687155d06bc8cb9ff6dc48596a138460c", - "reference": "f184d3d687155d06bc8cb9ff6dc48596a138460c", + "url": "https://api.github.com/repos/laravel/sail/zipball/d17abae06661dd6c46d13627b1683a2924259145", + "reference": "d17abae06661dd6c46d13627b1683a2924259145", "shasum": "" }, "require": { @@ -12020,20 +12025,20 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2024-10-10T13:26:02+00:00" + "time": "2024-11-11T20:16:51+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.23.2", + "version": "v1.23.3", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "689720d724c771ac4add859056744b7b3f2406da" + "reference": "687400043d77943ef95e8417cb44e1673ee57844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/689720d724c771ac4add859056744b7b3f2406da", - "reference": "689720d724c771ac4add859056744b7b3f2406da", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/687400043d77943ef95e8417cb44e1673ee57844", + "reference": "687400043d77943ef95e8417cb44e1673ee57844", "shasum": "" }, "require": { @@ -12086,9 +12091,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.2" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.3" }, - "time": "2024-09-16T11:23:09+00:00" + "time": "2024-10-29T12:24:25+00:00" }, { "name": "mockery/mockery", @@ -12175,16 +12180,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -12223,7 +12228,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -12231,7 +12236,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nunomaduro/collision", @@ -12450,16 +12455,16 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "5.10.0", + "version": "5.10.1", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "91d980ab76c3f152481e367f62b921adc38af451" + "reference": "b14fd66496a22d8dd7f7e2791edd9e8674422f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/91d980ab76c3f152481e367f62b921adc38af451", - "reference": "91d980ab76c3f152481e367f62b921adc38af451", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/b14fd66496a22d8dd7f7e2791edd9e8674422f17", + "reference": "b14fd66496a22d8dd7f7e2791edd9e8674422f17", "shasum": "" }, "require": { @@ -12533,20 +12538,20 @@ "type": "other" } ], - "time": "2024-08-29T20:56:34+00:00" + "time": "2024-11-10T04:10:31+00:00" }, { "name": "phpstan/phpstan", - "version": "1.12.7", + "version": "1.12.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "dc2b9976bd8b0f84ec9b0e50cc35378551de7af0" + "reference": "fc463b5d0fe906dcf19689be692c65c50406a071" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc2b9976bd8b0f84ec9b0e50cc35378551de7af0", - "reference": "dc2b9976bd8b0f84ec9b0e50cc35378551de7af0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/fc463b5d0fe906dcf19689be692c65c50406a071", + "reference": "fc463b5d0fe906dcf19689be692c65c50406a071", "shasum": "" }, "require": { @@ -12591,7 +12596,7 @@ "type": "github" } ], - "time": "2024-10-18T11:12:07+00:00" + "time": "2024-11-11T15:37:09+00:00" }, { "name": "phpunit/php-code-coverage", @@ -12916,16 +12921,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.37", + "version": "10.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c7cffa0efa2b70c22366523e6d804c9419eb2400" + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c7cffa0efa2b70c22366523e6d804c9419eb2400", - "reference": "c7cffa0efa2b70c22366523e6d804c9419eb2400", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a86773b9e887a67bc53efa9da9ad6e3f2498c132", + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132", "shasum": "" }, "require": { @@ -12997,7 +13002,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.37" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.38" }, "funding": [ { @@ -13013,7 +13018,7 @@ "type": "tidelift" } ], - "time": "2024-10-19T13:03:41+00:00" + "time": "2024-10-28T13:06:21+00:00" }, { "name": "predis/predis", @@ -13994,16 +13999,16 @@ }, { "name": "symfony/yaml", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4" + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4e561c316e135e053bd758bf3b3eb291d9919de4", - "reference": "4e561c316e135e053bd758bf3b3eb291d9919de4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", "shasum": "" }, "require": { @@ -14045,7 +14050,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.1.5" + "source": "https://github.com/symfony/yaml/tree/v7.1.6" }, "funding": [ { @@ -14061,7 +14066,7 @@ "type": "tidelift" } ], - "time": "2024-09-17T12:49:58+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "theseer/tokenizer", diff --git a/database/factories/Auth/UserFactory.php b/database/factories/Auth/UserFactory.php index 6d33ab9de..85fd4bec0 100644 --- a/database/factories/Auth/UserFactory.php +++ b/database/factories/Auth/UserFactory.php @@ -5,7 +5,9 @@ namespace Database\Factories\Auth; use App\Models\Auth\Permission; +use App\Models\Auth\Role; use App\Models\Auth\User; +use Database\Seeders\Auth\Permission\PermissionSeeder; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; use Illuminate\Support\Facades\App; @@ -65,4 +67,26 @@ function (User $user) use ($abilities) { } ); } + + /** + * Create the admin role with all permissions. + * + * @return static + */ + public function withAdmin(): static + { + return $this->afterCreating( + function (User $user) { + $admin = Role::findOrCreate('Admin'); + + $permissionSeeder = new PermissionSeeder(); + + $permissionSeeder->run(); + + $admin->givePermissionTo(Permission::all()); + + $user->assignRole($admin); + } + ); + } } diff --git a/database/factories/List/External/ExternalEntryFactory.php b/database/factories/List/External/ExternalEntryFactory.php index e619ead65..f269f3bdc 100644 --- a/database/factories/List/External/ExternalEntryFactory.php +++ b/database/factories/List/External/ExternalEntryFactory.php @@ -38,7 +38,7 @@ public function definition(): array return [ ExternalEntry::ATTRIBUTE_WATCH_STATUS => $watchStatus->value, - ExternalEntry::ATTRIBUTE_SCORE => fake()->randomFloat(), + ExternalEntry::ATTRIBUTE_SCORE => fake()->randomFloat(2), ExternalEntry::ATTRIBUTE_IS_FAVORITE => fake()->boolean(), ]; } diff --git a/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php b/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php index 8e7f6fe35..648cfd4d9 100644 --- a/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php +++ b/database/factories/Wiki/Anime/Theme/AnimeThemeEntryFactory.php @@ -4,6 +4,8 @@ namespace Database\Factories\Wiki\Anime\Theme; +use App\Models\Wiki\Anime; +use App\Models\Wiki\Anime\AnimeTheme; use App\Models\Wiki\Anime\Theme\AnimeThemeEntry; use Illuminate\Database\Eloquent\Factories\Factory; @@ -40,4 +42,14 @@ public function definition(): array AnimeThemeEntry::ATTRIBUTE_VERSION => fake()->randomDigitNotNull(), ]; } + + /** + * Add anime and theme to the entry. + * + * @return static + */ + public function forAnime(): static + { + return $this->for(AnimeTheme::factory()->for(Anime::factory())); + } } diff --git a/database/factories/Wiki/AnimeFactory.php b/database/factories/Wiki/AnimeFactory.php index ac42738da..b1b8c0145 100644 --- a/database/factories/Wiki/AnimeFactory.php +++ b/database/factories/Wiki/AnimeFactory.php @@ -45,13 +45,14 @@ class AnimeFactory extends Factory */ public function definition(): array { + $name = fake()->words(3, true); $season = Arr::random(AnimeSeason::cases()); $media_format = Arr::random(AnimeMediaFormat::cases()); return [ - Anime::ATTRIBUTE_NAME => fake()->words(3, true), + Anime::ATTRIBUTE_NAME => $name, Anime::ATTRIBUTE_SEASON => $season->value, - Anime::ATTRIBUTE_SLUG => Str::slug(fake()->text(191), '_'), + Anime::ATTRIBUTE_SLUG => Str::slug($name, '_'), Anime::ATTRIBUTE_SYNOPSIS => fake()->text(), Anime::ATTRIBUTE_YEAR => fake()->numberBetween(1960, intval(date('Y')) + 1), Anime::ATTRIBUTE_MEDIA_FORMAT => $media_format->value, diff --git a/database/factories/Wiki/ArtistFactory.php b/database/factories/Wiki/ArtistFactory.php index d402e6758..b83dea66b 100644 --- a/database/factories/Wiki/ArtistFactory.php +++ b/database/factories/Wiki/ArtistFactory.php @@ -38,9 +38,11 @@ class ArtistFactory extends Factory */ public function definition(): array { + $name = fake()->words(3, true); + return [ - Artist::ATTRIBUTE_SLUG => Str::slug(fake()->text(191), '_'), - Artist::ATTRIBUTE_NAME => fake()->words(3, true), + Artist::ATTRIBUTE_SLUG => Str::slug($name, '_'), + Artist::ATTRIBUTE_NAME => $name, ]; } diff --git a/database/factories/Wiki/ExternalResourceFactory.php b/database/factories/Wiki/ExternalResourceFactory.php index 3cd77df50..e9071a8eb 100644 --- a/database/factories/Wiki/ExternalResourceFactory.php +++ b/database/factories/Wiki/ExternalResourceFactory.php @@ -36,9 +36,11 @@ public function definition(): array { $site = Arr::random(ResourceSite::cases()); + $link = fake()->url(); + return [ - ExternalResource::ATTRIBUTE_EXTERNAL_ID => fake()->randomNumber(), - ExternalResource::ATTRIBUTE_LINK => fake()->url(), + ExternalResource::ATTRIBUTE_EXTERNAL_ID => ResourceSite::parseIdFromLink($link), + ExternalResource::ATTRIBUTE_LINK => $link, ExternalResource::ATTRIBUTE_SITE => $site->value, ]; } diff --git a/tests/Feature/Http/Api/List/External/Entry/ExternalEntryShowTest.php b/tests/Feature/Http/Api/List/External/Entry/ExternalEntryShowTest.php index 68214f357..1d162aac0 100644 --- a/tests/Feature/Http/Api/List/External/Entry/ExternalEntryShowTest.php +++ b/tests/Feature/Http/Api/List/External/Entry/ExternalEntryShowTest.php @@ -19,7 +19,6 @@ use App\Models\List\ExternalProfile; use App\Models\List\External\ExternalEntry; use App\Models\Wiki\Anime; -use App\Models\Wiki\Video; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Event; use Laravel\Sanctum\Sanctum; diff --git a/tests/Unit/Filament/BaseResourceTest.php b/tests/Unit/Filament/BaseResourceTest.php new file mode 100644 index 000000000..3a8b85922 --- /dev/null +++ b/tests/Unit/Filament/BaseResourceTest.php @@ -0,0 +1,31 @@ +withPermissions(SpecialPermission::VIEW_FILAMENT->value) + ->createOne(); + + $this->actingAs($user); + } +} diff --git a/tests/Unit/Filament/Resources/Admin/AnnouncementTest.php b/tests/Unit/Filament/Resources/Admin/AnnouncementTest.php new file mode 100644 index 000000000..2ff38c349 --- /dev/null +++ b/tests/Unit/Filament/Resources/Admin/AnnouncementTest.php @@ -0,0 +1,124 @@ +getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnnouncementModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = AnnouncementModel::factory()->count(10)->create(); + + $this->get(Announcement::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + Livewire::test(static::getIndexPage()) + ->assertActionHidden(CreateAction::class); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = AnnouncementModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(EditAction::class, $record); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = AnnouncementModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(DeleteAction::class, $record); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = AnnouncementModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(RestoreAction::class, $record); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = AnnouncementModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(ForceDeleteAction::class, $record); + } +} diff --git a/tests/Unit/Filament/Resources/Admin/DumpTest.php b/tests/Unit/Filament/Resources/Admin/DumpTest.php new file mode 100644 index 000000000..8c3258401 --- /dev/null +++ b/tests/Unit/Filament/Resources/Admin/DumpTest.php @@ -0,0 +1,112 @@ +getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(DumpModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = DumpModel::factory()->count(10)->create(); + + $this->get(Dump::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = DumpModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(EditAction::class, $record); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = DumpModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(DeleteAction::class, $record); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = DumpModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(RestoreAction::class, $record); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = DumpModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(ForceDeleteAction::class, $record); + } +} diff --git a/tests/Unit/Filament/Resources/Admin/FeatureTest.php b/tests/Unit/Filament/Resources/Admin/FeatureTest.php new file mode 100644 index 000000000..3939c4bc1 --- /dev/null +++ b/tests/Unit/Filament/Resources/Admin/FeatureTest.php @@ -0,0 +1,112 @@ +getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(FeatureModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = FeatureModel::factory()->count(10)->create(); + + $this->get(Feature::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = FeatureModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(EditAction::class, $record); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = FeatureModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(DeleteAction::class, $record); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = FeatureModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(RestoreAction::class, $record); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = FeatureModel::factory()->createOne(); + + Livewire::test(static::getIndexPage()) + ->assertTableActionHidden(ForceDeleteAction::class, $record); + } +} diff --git a/tests/Unit/Filament/Resources/Admin/FeaturedThemeTest.php b/tests/Unit/Filament/Resources/Admin/FeaturedThemeTest.php new file mode 100644 index 000000000..fb429a139 --- /dev/null +++ b/tests/Unit/Filament/Resources/Admin/FeaturedThemeTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = FeaturedTheme::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(FeaturedThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = FeaturedThemeModel::factory()->count(10)->create(); + + $this->get(FeaturedTheme::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(FeaturedThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(FeaturedTheme::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(FeaturedThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = FeaturedThemeModel::factory()->createOne(); + + $this->get(FeaturedTheme::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(FeaturedThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = FeaturedThemeModel::factory()->createOne(); + + $this->get(FeaturedTheme::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(FeaturedTheme::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = FeaturedThemeModel::factory()->createOne(); + + $this->get(FeaturedTheme::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = FeaturedThemeModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = FeaturedThemeModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = FeaturedThemeModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Discord/DiscordThreadTest.php b/tests/Unit/Filament/Resources/Discord/DiscordThreadTest.php new file mode 100644 index 000000000..25bcb3acf --- /dev/null +++ b/tests/Unit/Filament/Resources/Discord/DiscordThreadTest.php @@ -0,0 +1,182 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = DiscordThread::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(DiscordThreadModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = DiscordThreadModel::factory() + ->for(Anime::factory()) + ->count(10) + ->create(); + + $this->get(DiscordThread::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(DiscordThreadModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(DiscordThread::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(DiscordThreadModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = DiscordThreadModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(DiscordThread::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(DiscordThreadModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = DiscordThreadModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(DiscordThread::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(DiscordThread::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = DiscordThreadModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(DiscordThread::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = DiscordThreadModel::factory() + ->for(Anime::factory()) + ->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Document/PageTest.php b/tests/Unit/Filament/Resources/Document/PageTest.php new file mode 100644 index 000000000..6bb09391d --- /dev/null +++ b/tests/Unit/Filament/Resources/Document/PageTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Page::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = PageModel::factory()->count(10)->create(); + + $this->get(Page::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(PageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Page::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(PageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = PageModel::factory()->createOne(); + + $this->get(Page::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = PageModel::factory()->createOne(); + + $this->get(Page::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Page::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = PageModel::factory()->createOne(); + + $this->get(Page::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = PageModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = PageModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = PageModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/List/External/ExternalEntryTest.php b/tests/Unit/Filament/Resources/List/External/ExternalEntryTest.php new file mode 100644 index 000000000..a141f21f5 --- /dev/null +++ b/tests/Unit/Filament/Resources/List/External/ExternalEntryTest.php @@ -0,0 +1,136 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = ExternalEntry::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $profile = ExternalProfile::factory()->entries(3)->createOne(); + + $records = $profile->externalentries; + + $this->get(ExternalEntry::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(ExternalEntryModel::class), + ) + ->createOne(); + + $this->actingAs($user); + + $profile = ExternalProfile::factory()->entries(3)->createOne(); + + $record = $profile->externalentries->first(); + + $this->get(ExternalEntry::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + + $profile = ExternalProfile::factory()->entries(3)->createOne(); + + $record = $profile->externalentries->first(); + + $this->get(ExternalEntry::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } +} diff --git a/tests/Unit/Filament/Resources/List/ExternalProfileTest.php b/tests/Unit/Filament/Resources/List/ExternalProfileTest.php new file mode 100644 index 000000000..8169b79f4 --- /dev/null +++ b/tests/Unit/Filament/Resources/List/ExternalProfileTest.php @@ -0,0 +1,149 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = ExternalProfile::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalProfileModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = ExternalProfileModel::factory()->count(10)->create(); + + $this->get(ExternalProfile::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(ExternalProfileModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(ExternalProfile::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(ExternalProfileModel::class), + ) + ->createOne(); + + $this->actingAs($user); + + $record = ExternalProfileModel::factory()->createOne(); + + $this->get(ExternalProfile::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalProfileModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ExternalProfileModel::factory()->createOne(); + + $this->get(ExternalProfile::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } +} diff --git a/tests/Unit/Filament/Resources/List/Playlist/TrackTest.php b/tests/Unit/Filament/Resources/List/Playlist/TrackTest.php new file mode 100644 index 000000000..32c2dbd5b --- /dev/null +++ b/tests/Unit/Filament/Resources/List/Playlist/TrackTest.php @@ -0,0 +1,156 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Track::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PlaylistTrackModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $playlist = Playlist::factory()->tracks(3)->create(); + + $records = $playlist->tracks; + + $this->get(Track::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(PlaylistTrackModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Track::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(PlaylistTrackModel::class), + ) + ->createOne(); + + $this->actingAs($user); + + $playlist = Playlist::factory()->tracks(3)->create(); + + $record = $playlist->tracks->first(); + + $this->get(Track::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PlaylistTrackModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $playlist = Playlist::factory()->tracks(3)->create(); + + $record = $playlist->tracks->first(); + + $this->get(Track::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } +} diff --git a/tests/Unit/Filament/Resources/List/PlaylistTest.php b/tests/Unit/Filament/Resources/List/PlaylistTest.php new file mode 100644 index 000000000..2fa9e3668 --- /dev/null +++ b/tests/Unit/Filament/Resources/List/PlaylistTest.php @@ -0,0 +1,149 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Playlist::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PlaylistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = PlaylistModel::factory()->count(10)->create(); + + $this->get(Playlist::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(PlaylistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Playlist::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(PlaylistModel::class), + ) + ->createOne(); + + $this->actingAs($user); + + $record = PlaylistModel::factory()->createOne(); + + $this->get(Playlist::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withAdmin() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(PlaylistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = PlaylistModel::factory()->createOne(); + + $this->get(Playlist::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/Anime/Theme/EntryTest.php b/tests/Unit/Filament/Resources/Wiki/Anime/Theme/EntryTest.php new file mode 100644 index 000000000..8222e6b97 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/Anime/Theme/EntryTest.php @@ -0,0 +1,214 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Entry::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeThemeEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = AnimeThemeEntryModel::factory() + ->forAnime() + ->count(10)->create(); + + $this->get(Entry::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(AnimeThemeEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Entry::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(AnimeThemeEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + $this->get(Entry::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeThemeEntryModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + $this->get(Entry::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Entry::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + $this->get(Entry::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = AnimeThemeEntryModel::factory() + ->forAnime() + ->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/Anime/ThemeTest.php b/tests/Unit/Filament/Resources/Wiki/Anime/ThemeTest.php new file mode 100644 index 000000000..7ee8cb134 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/Anime/ThemeTest.php @@ -0,0 +1,215 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Theme::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->count(10)->create(); + + $this->get(Theme::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(AnimeThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Theme::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(AnimeThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(Theme::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeThemeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(Theme::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Theme::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $this->get(Theme::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = AnimeThemeModel::factory() + ->for(Anime::factory()) + ->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/AnimeTest.php b/tests/Unit/Filament/Resources/Wiki/AnimeTest.php new file mode 100644 index 000000000..89152805b --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/AnimeTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Anime::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = AnimeModel::factory()->count(10)->create(); + + $this->get(Anime::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(AnimeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Anime::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(AnimeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeModel::factory()->createOne(); + + $this->get(Anime::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AnimeModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AnimeModel::factory()->createOne(); + + $this->get(Anime::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Anime::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = AnimeModel::factory()->createOne(); + + $this->get(Anime::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = AnimeModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = AnimeModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = AnimeModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/ArtistTest.php b/tests/Unit/Filament/Resources/Wiki/ArtistTest.php new file mode 100644 index 000000000..a7dffdf5d --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/ArtistTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Artist::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ArtistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = ArtistModel::factory()->count(10)->create(); + + $this->get(Artist::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(ArtistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Artist::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(ArtistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ArtistModel::factory()->createOne(); + + $this->get(Artist::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ArtistModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ArtistModel::factory()->createOne(); + + $this->get(Artist::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Artist::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = ArtistModel::factory()->createOne(); + + $this->get(Artist::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = ArtistModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = ArtistModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = ArtistModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/AudioTest.php b/tests/Unit/Filament/Resources/Wiki/AudioTest.php new file mode 100644 index 000000000..2c127177a --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/AudioTest.php @@ -0,0 +1,181 @@ +getPage(); + } + + /** + * Get the edit page class of the resource. + * + * @return string + */ + protected static function getEditPage(): string + { + $pages = Audio::getPages(); + + return $pages['edit']->getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Audio::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = AudioModel::factory()->count(10)->create(); + + $this->get(Audio::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(AudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AudioModel::factory()->createOne(); + + $this->get(Audio::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(AudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = AudioModel::factory()->createOne(); + + $this->get(Audio::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = AudioModel::factory()->createOne(); + + $this->get(Audio::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = AudioModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = AudioModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = AudioModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/ExternalResourceTest.php b/tests/Unit/Filament/Resources/Wiki/ExternalResourceTest.php new file mode 100644 index 000000000..d6e51cc4b --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/ExternalResourceTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = ExternalResource::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalResourceModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = ExternalResourceModel::factory()->count(10)->create(); + + $this->get(ExternalResource::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(ExternalResourceModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(ExternalResource::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(ExternalResourceModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ExternalResourceModel::factory()->createOne(); + + $this->get(ExternalResource::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ExternalResourceModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ExternalResourceModel::factory()->createOne(); + + $this->get(ExternalResource::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(ExternalResource::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = ExternalResourceModel::factory()->createOne(); + + $this->get(ExternalResource::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = ExternalResourceModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = ExternalResourceModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = ExternalResourceModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/GroupTest.php b/tests/Unit/Filament/Resources/Wiki/GroupTest.php new file mode 100644 index 000000000..b1a8e8284 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/GroupTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Group::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(GroupModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = GroupModel::factory()->count(10)->create(); + + $this->get(Group::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(GroupModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Group::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(GroupModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = GroupModel::factory()->createOne(); + + $this->get(Group::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(GroupModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = GroupModel::factory()->createOne(); + + $this->get(Group::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Group::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = GroupModel::factory()->createOne(); + + $this->get(Group::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = GroupModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = GroupModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = GroupModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/ImageTest.php b/tests/Unit/Filament/Resources/Wiki/ImageTest.php new file mode 100644 index 000000000..0686c1802 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/ImageTest.php @@ -0,0 +1,181 @@ +getPage(); + } + + /** + * Get the edit page class of the resource. + * + * @return string + */ + protected static function getEditPage(): string + { + $pages = Image::getPages(); + + return $pages['edit']->getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Image::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ImageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = ImageModel::factory()->count(10)->create(); + + $this->get(Image::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(ImageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ImageModel::factory()->createOne(); + + $this->get(Image::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(ImageModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = ImageModel::factory()->createOne(); + + $this->get(Image::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = ImageModel::factory()->createOne(); + + $this->get(Image::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = ImageModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = ImageModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = ImageModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/SeriesTest.php b/tests/Unit/Filament/Resources/Wiki/SeriesTest.php new file mode 100644 index 000000000..3824c758c --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/SeriesTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Series::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(SeriesModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = SeriesModel::factory()->count(10)->create(); + + $this->get(Series::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(SeriesModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Series::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(SeriesModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = SeriesModel::factory()->createOne(); + + $this->get(Series::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(SeriesModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = SeriesModel::factory()->createOne(); + + $this->get(Series::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Series::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = SeriesModel::factory()->createOne(); + + $this->get(Series::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = SeriesModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = SeriesModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = SeriesModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/SongTest.php b/tests/Unit/Filament/Resources/Wiki/SongTest.php new file mode 100644 index 000000000..537e90726 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/SongTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Song::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(SongModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = SongModel::factory()->count(10)->create(); + + $this->get(Song::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(SongModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Song::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(SongModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = SongModel::factory()->createOne(); + + $this->get(Song::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(SongModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = SongModel::factory()->createOne(); + + $this->get(Song::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Song::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = SongModel::factory()->createOne(); + + $this->get(Song::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = SongModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = SongModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = SongModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/StudioTest.php b/tests/Unit/Filament/Resources/Wiki/StudioTest.php new file mode 100644 index 000000000..efddced34 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/StudioTest.php @@ -0,0 +1,200 @@ +getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Studio::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(StudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = StudioModel::factory()->count(10)->create(); + + $this->get(Studio::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The create page of the resource shall be rendered. + * + * @return void + */ + public function testRenderCreatePage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::CREATE->format(StudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $this->get(Studio::getUrl('create')) + ->assertSuccessful(); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(StudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = StudioModel::factory()->createOne(); + + $this->get(Studio::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(StudioModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = StudioModel::factory()->createOne(); + + $this->get(Studio::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot create a record. + * + * @return void + */ + public function testUserCannotCreateRecord(): void + { + $this->get(Studio::getUrl('create')) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = StudioModel::factory()->createOne(); + + $this->get(Studio::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = StudioModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = StudioModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = StudioModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/Video/ScriptTest.php b/tests/Unit/Filament/Resources/Wiki/Video/ScriptTest.php new file mode 100644 index 000000000..914995f7c --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/Video/ScriptTest.php @@ -0,0 +1,181 @@ +getPage(); + } + + /** + * Get the edit page class of the resource. + * + * @return string + */ + protected static function getEditPage(): string + { + $pages = Script::getPages(); + + return $pages['edit']->getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Script::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(VideoScriptModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = VideoScriptModel::factory()->count(10)->create(); + + $this->get(Script::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(VideoScriptModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = VideoScriptModel::factory()->createOne(); + + $this->get(Script::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(VideoScriptModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = VideoScriptModel::factory()->createOne(); + + $this->get(Script::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = VideoScriptModel::factory()->createOne(); + + $this->get(Script::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = VideoScriptModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = VideoScriptModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = VideoScriptModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +} diff --git a/tests/Unit/Filament/Resources/Wiki/VideoTest.php b/tests/Unit/Filament/Resources/Wiki/VideoTest.php new file mode 100644 index 000000000..5998ebce7 --- /dev/null +++ b/tests/Unit/Filament/Resources/Wiki/VideoTest.php @@ -0,0 +1,181 @@ +getPage(); + } + + /** + * Get the edit page class of the resource. + * + * @return string + */ + protected static function getEditPage(): string + { + $pages = Video::getPages(); + + return $pages['edit']->getPage(); + } + + /** + * Get the view page class of the resource. + * + * @return string + */ + protected static function getViewPage(): string + { + $pages = Video::getPages(); + + return $pages['view']->getPage(); + } + + /** + * The index page of the resource shall be rendered. + * + * @return void + */ + public function testRenderIndexPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(VideoModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $records = VideoModel::factory()->count(10)->create(); + + $this->get(Video::getUrl('index')) + ->assertSuccessful(); + + Livewire::test(static::getIndexPage()) + ->assertCanSeeTableRecords($records); + } + + /** + * The edit page of the resource shall be rendered. + * + * @return void + */ + public function testRenderEditPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::UPDATE->format(VideoModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = VideoModel::factory()->createOne(); + + $this->get(Video::getUrl('edit', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The view page of the resource shall be rendered. + * + * @return void + */ + public function testRenderViewPage(): void + { + $user = User::factory() + ->withPermissions( + SpecialPermission::VIEW_FILAMENT->value, + CrudPermission::VIEW->format(VideoModel::class) + ) + ->createOne(); + + $this->actingAs($user); + + $record = VideoModel::factory()->createOne(); + + $this->get(Video::getUrl('view', ['record' => $record])) + ->assertSuccessful(); + } + + /** + * The user with no permissions cannot edit a record. + * + * @return void + */ + public function testUserCannotEditRecord(): void + { + $record = VideoModel::factory()->createOne(); + + $this->get(Video::getUrl('edit', ['record' => $record])) + ->assertForbidden(); + } + + /** + * The user with no permissions cannot delete a record. + * + * @return void + */ + public function testUserCannotDeleteRecord(): void + { + $record = VideoModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(DeleteHeaderAction::class); + } + + /** + * The user with no permissions cannot restore a record. + * + * @return void + */ + public function testUserCannotRestoreRecord(): void + { + $record = VideoModel::factory()->createOne(); + + $record->delete(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(RestoreHeaderAction::class); + } + + /** + * The user with no permissions cannot force delete a record. + * + * @return void + */ + public function testUserCannotForceDeleteRecord(): void + { + $record = VideoModel::factory()->createOne(); + + Livewire::test(static::getViewPage(), ['record' => $record->getKey()]) + ->assertActionHidden(ForceDeleteHeaderAction::class); + } +}