mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
chore: bump dependencies (#1185)
This commit is contained in:
@@ -25,8 +25,8 @@ class AnimeStudioTab extends BaseTab
|
||||
return $query->whereDoesntHave(Anime::RELATION_STUDIOS);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Anime::query()->whereDoesntHave(Anime::RELATION_STUDIOS)->count();
|
||||
return (string) Anime::query()->whereDoesntHave(Anime::RELATION_STUDIOS)->count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ class ArtistPerformanceTab extends BaseTab
|
||||
->whereDoesntHave(Artist::RELATION_MEMBER_PERFORMANCES);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Artist::query()
|
||||
return (string) Artist::query()
|
||||
->whereDoesntHave(Artist::RELATION_PERFORMANCES)
|
||||
->whereDoesntHave(Artist::RELATION_MEMBER_PERFORMANCES)
|
||||
->count();
|
||||
|
||||
@@ -25,8 +25,8 @@ class AudioVideoTab extends BaseTab
|
||||
return $query->whereDoesntHave(Audio::RELATION_VIDEOS);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Audio::query()->whereDoesntHave(Audio::RELATION_VIDEOS)->count();
|
||||
return (string) Audio::query()->whereDoesntHave(Audio::RELATION_VIDEOS)->count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ abstract class BaseTab extends Tab
|
||||
|
||||
public function count(): mixed
|
||||
{
|
||||
$count = Cache::flexible("filament_badge_{$this->getSlug()}", [15, 60], fn (): string|int|float|null => $this->getBadge());
|
||||
$count = Cache::flexible("filament_badge_{$this->getSlug()}", [15, 60], fn (): ?string => $this->getBadge());
|
||||
|
||||
$this->badge($count);
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ class ExternalResourceUnlinkedTab extends BaseTab
|
||||
->whereDoesntHave(ExternalResource::RELATION_STUDIOS);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return ExternalResource::query()
|
||||
return (string) ExternalResource::query()
|
||||
->whereDoesntHave(ExternalResource::RELATION_ANIME)
|
||||
->whereDoesntHave(ExternalResource::RELATION_ANIMETHEMEENTRIES)
|
||||
->whereDoesntHave(ExternalResource::RELATION_ARTISTS)
|
||||
|
||||
@@ -32,9 +32,9 @@ class ImageUnlinkedTab extends BaseTab
|
||||
->whereDoesntHave(Image::RELATION_PLAYLISTS);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Image::query()
|
||||
return (string) Image::query()
|
||||
->whereNot(Image::ATTRIBUTE_FACET, ImageFacet::GRILL->value)
|
||||
->whereNot(Image::ATTRIBUTE_FACET, ImageFacet::DOCUMENT->value)
|
||||
->whereDoesntHave(Image::RELATION_ANIME)
|
||||
|
||||
@@ -25,8 +25,8 @@ class SongPerformanceTab extends BaseTab
|
||||
return $query->whereDoesntHave(Song::RELATION_PERFORMANCES);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Song::query()->whereDoesntHave(Song::RELATION_PERFORMANCES)->count();
|
||||
return (string) Song::query()->whereDoesntHave(Song::RELATION_PERFORMANCES)->count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class StudioUnlinkedTab extends BaseTab
|
||||
return $query->whereDoesntHave(Studio::RELATION_ANIME);
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Studio::query()->whereDoesntHave(Studio::RELATION_ANIME)->count();
|
||||
return (string) Studio::query()->whereDoesntHave(Studio::RELATION_ANIME)->count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ class VideoAudioTab extends BaseTab
|
||||
->where(Video::ATTRIBUTE_PATH, ComparisonOperator::NOTLIKE->value, 'misc%');
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Video::query()
|
||||
return (string) Video::query()
|
||||
->whereDoesntHave(Video::RELATION_AUDIO)
|
||||
->where(Video::ATTRIBUTE_PATH, ComparisonOperator::NOTLIKE->value, 'misc%')
|
||||
->count();
|
||||
|
||||
@@ -28,9 +28,9 @@ class VideoUnlinkedTab extends BaseTab
|
||||
->where(Video::ATTRIBUTE_PATH, ComparisonOperator::NOTLIKE->value, 'misc%');
|
||||
}
|
||||
|
||||
public function getBadge(): int
|
||||
public function getBadge(): ?string
|
||||
{
|
||||
return Video::query()
|
||||
return (string) Video::query()
|
||||
->whereDoesntHave(Video::RELATION_ANIMETHEMEENTRIES)
|
||||
->where(Video::ATTRIBUTE_PATH, ComparisonOperator::NOTLIKE->value, 'misc%')
|
||||
->count();
|
||||
|
||||
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use AjCastro\EagerLoadPivotRelations\EagerLoadPivotTrait;
|
||||
use App\Concerns\Filament\ActionLogs\ModelHasActionLogs;
|
||||
use App\Contracts\Models\HasSubtitle;
|
||||
use App\Contracts\Models\Nameable;
|
||||
@@ -19,7 +18,6 @@ use Illuminate\Support\Str;
|
||||
*/
|
||||
abstract class BaseModel extends Model implements HasSubtitle, Nameable
|
||||
{
|
||||
use EagerLoadPivotTrait;
|
||||
use ModelHasActionLogs;
|
||||
|
||||
/**
|
||||
|
||||
+13
-14
@@ -23,8 +23,7 @@
|
||||
"ext-fileinfo": "*",
|
||||
"ext-gd": "*",
|
||||
"ext-pdo": "*",
|
||||
"ajcastro/eager-load-pivot-relations": "^0.3.0",
|
||||
"awcodes/recently": "^3.0.1",
|
||||
"awcodes/recently": "^3.0.2",
|
||||
"babenkoivan/elastic-adapter": "^5.1",
|
||||
"babenkoivan/elastic-migrations": "^5",
|
||||
"babenkoivan/elastic-scout-driver": "^6",
|
||||
@@ -32,20 +31,20 @@
|
||||
"bepsvpt/secure-headers": "^7.5",
|
||||
"elemind/filament-echarts": "^1.1",
|
||||
"fakerphp/faker": "^1.24.1",
|
||||
"filament/filament": "^5.4.5",
|
||||
"filament/filament": "^5.6.0",
|
||||
"flowframe/laravel-trend": "^0.5.0",
|
||||
"guzzlehttp/guzzle": "^7.10.0",
|
||||
"kyrch/laravel-prohibitions": "^1.2.0",
|
||||
"larastan/larastan": "^3.9.3",
|
||||
"larastan/larastan": "^3.9.6",
|
||||
"laravel-notification-channels/discord": "^1.8",
|
||||
"laravel/fortify": "^1.36.2",
|
||||
"laravel/framework": "^13.4.0",
|
||||
"laravel/horizon": "^5.45.5",
|
||||
"laravel/framework": "^13.6.0",
|
||||
"laravel/horizon": "^5.46.0",
|
||||
"laravel/pennant": "^1.23.0",
|
||||
"laravel/pulse": "^1.7.3",
|
||||
"laravel/sanctum": "^4.3.1",
|
||||
"laravel/scout": "^11.1",
|
||||
"laravel/tinker": "^3.0",
|
||||
"laravel/tinker": "^3.0.2",
|
||||
"league/flysystem-aws-s3-v3": "^3.32.0",
|
||||
"mll-lab/graphql-php-scalars": "^6.4.1",
|
||||
"mll-lab/laravel-graphiql": "^4.1",
|
||||
@@ -57,7 +56,7 @@
|
||||
"spatie/laravel-permission": "^6.25.0",
|
||||
"staudenmeir/belongs-to-through": "^2.18",
|
||||
"staudenmeir/eloquent-has-many-deep": "^1.22.1",
|
||||
"staudenmeir/laravel-adjacency-list": "^1.26.0",
|
||||
"staudenmeir/laravel-adjacency-list": "^1.26.1",
|
||||
"symfony/http-client": "^6.4.36",
|
||||
"symfony/mailgun-mailer": "^6.4.24",
|
||||
"tapp/filament-auditing": "^4.0.9",
|
||||
@@ -66,15 +65,15 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"driftingly/rector-laravel": "^2.3.0",
|
||||
"fruitcake/laravel-debugbar": "^4.2.5",
|
||||
"laravel/pint": "^1.29.0",
|
||||
"laravel/sail": "^1.56.0",
|
||||
"fruitcake/laravel-debugbar": "^4.2.8",
|
||||
"laravel/pint": "^1.29.1",
|
||||
"laravel/sail": "^1.57.0",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"mrpunyapal/rector-pest": "^0.2.7",
|
||||
"pestphp/pest": "^4.4.5",
|
||||
"mrpunyapal/rector-pest": "^0.2.11",
|
||||
"pestphp/pest": "^4.6.3",
|
||||
"pestphp/pest-plugin-laravel": "^4.1",
|
||||
"predis/predis": "^2.4.1",
|
||||
"rector/rector": "^2.4.1"
|
||||
"rector/rector": "^2.4.2"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
|
||||
Generated
+361
-347
File diff suppressed because it is too large
Load Diff
+2
-5
@@ -37,10 +37,7 @@ parameters:
|
||||
identifier: nullsafe.neverNull
|
||||
path: app/Scout/Typesense/Models/*
|
||||
-
|
||||
message: '#Call to an undefined method PHPUnit\\Framework\\TestCase::.*\(\)#'
|
||||
path: tests/*
|
||||
-
|
||||
message: '#Call to protected method expectException\(\) of class PHPUnit\\Framework\\TestCase.#'
|
||||
message: '#Call to an undefined method Pest\\PendingCalls\\TestCall::.*\(\)#'
|
||||
path: tests/*
|
||||
-
|
||||
message: '#Call to an undefined method Pest\\PendingCalls\\TestCall::expect\(\).#'
|
||||
@@ -58,5 +55,5 @@ parameters:
|
||||
message: '#Call to method assertActionDoesNotExist\(\) on an unknown class static.#'
|
||||
path: tests/Unit/Filament/*
|
||||
-
|
||||
message: '#Access to an undefined property PHPUnit\\Framework\\TestCase::\$mutation.#'
|
||||
message: '#Access to an undefined property Pest\\PendingCalls\\TestCall::\$mutation.#'
|
||||
path: tests/Feature/GraphQL/*
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -50,6 +50,7 @@ return RectorConfig::configure()
|
||||
__DIR__.'/database',
|
||||
__DIR__.'/public',
|
||||
__DIR__.'/routes',
|
||||
__DIR__.'/tests',
|
||||
])
|
||||
->withSkip([
|
||||
__DIR__.'/database/migrations',
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Actions\Fortify\CreateNewUser;
|
||||
use App\Constants\Config\ValidationConstants;
|
||||
use App\Enums\Rules\ModerationService;
|
||||
use App\Models\Auth\User;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -13,9 +14,9 @@ use Illuminate\Validation\ValidationException;
|
||||
use Mockery\MockInterface;
|
||||
use Propaganistas\LaravelDisposableEmail\Validation\Indisposable;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('required', function () {
|
||||
test('required', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$action = new CreateNewUser();
|
||||
@@ -23,7 +24,7 @@ test('required', function () {
|
||||
$action->create([]);
|
||||
});
|
||||
|
||||
test('username alpha dash', function () {
|
||||
test('username alpha dash', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$action = new CreateNewUser();
|
||||
@@ -39,7 +40,7 @@ test('username alpha dash', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('username unique', function () {
|
||||
test('username unique', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$name = fake()->word();
|
||||
@@ -61,7 +62,7 @@ test('username unique', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
$action = new CreateNewUser();
|
||||
|
||||
$password = Str::password(20);
|
||||
@@ -77,7 +78,7 @@ test('created', function () {
|
||||
$this->assertDatabaseCount(User::class, 1);
|
||||
});
|
||||
|
||||
test('created if not flagged by open ai', function () {
|
||||
test('created if not flagged by open ai', function (): void {
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
|
||||
Http::fake([
|
||||
@@ -105,7 +106,7 @@ test('created if not flagged by open ai', function () {
|
||||
$this->assertDatabaseCount(User::class, 1);
|
||||
});
|
||||
|
||||
test('created if open ai fails', function () {
|
||||
test('created if open ai fails', function (): void {
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
|
||||
Http::fake([
|
||||
@@ -127,7 +128,7 @@ test('created if open ai fails', function () {
|
||||
$this->assertDatabaseCount(User::class, 1);
|
||||
});
|
||||
|
||||
test('validation error when flagged by open ai', function () {
|
||||
test('validation error when flagged by open ai', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
@@ -155,10 +156,10 @@ test('validation error when flagged by open ai', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('disposable email', function () {
|
||||
test('disposable email', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock) {
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('validate')->once()->andReturn(false);
|
||||
});
|
||||
|
||||
@@ -175,8 +176,8 @@ test('disposable email', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('indisposable email', function () {
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock) {
|
||||
test('indisposable email', function (): void {
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('validate')->once()->andReturn(true);
|
||||
});
|
||||
|
||||
@@ -195,7 +196,7 @@ test('indisposable email', function () {
|
||||
$this->assertDatabaseCount(User::class, 1);
|
||||
});
|
||||
|
||||
test('email unique', function () {
|
||||
test('email unique', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$email = fake()->companyEmail();
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Constants\Config\ValidationConstants;
|
||||
use App\Enums\Rules\ModerationService;
|
||||
use App\Models\Auth\User;
|
||||
use Illuminate\Auth\Notifications\VerifyEmail;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
@@ -14,9 +15,9 @@ use Illuminate\Validation\ValidationException;
|
||||
use Mockery\MockInterface;
|
||||
use Propaganistas\LaravelDisposableEmail\Validation\Indisposable;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('required', function () {
|
||||
test('required', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$user = User::factory()->createOne();
|
||||
@@ -26,7 +27,7 @@ test('required', function () {
|
||||
$action->update($user, []);
|
||||
});
|
||||
|
||||
test('username alpha dash', function () {
|
||||
test('username alpha dash', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$user = User::factory()->createOne();
|
||||
@@ -38,7 +39,7 @@ test('username alpha dash', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('username unique', function () {
|
||||
test('username unique', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$name = fake()->word();
|
||||
@@ -56,7 +57,7 @@ test('username unique', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('update name', function () {
|
||||
test('update name', function (): void {
|
||||
$name = fake()->unique()->word();
|
||||
|
||||
$user = User::factory()->createOne([
|
||||
@@ -78,7 +79,7 @@ test('update name', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('update email', function () {
|
||||
test('update email', function (): void {
|
||||
Notification::fake();
|
||||
|
||||
$email = fake()->unique()->companyEmail();
|
||||
@@ -102,7 +103,7 @@ test('update email', function () {
|
||||
Notification::assertSentTimes(VerifyEmail::class, 1);
|
||||
});
|
||||
|
||||
test('created if not flagged by open ai', function () {
|
||||
test('created if not flagged by open ai', function (): void {
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
|
||||
Http::fake([
|
||||
@@ -136,7 +137,7 @@ test('created if not flagged by open ai', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('created if open ai fails', function () {
|
||||
test('created if open ai fails', function (): void {
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
|
||||
Http::fake([
|
||||
@@ -164,7 +165,7 @@ test('created if open ai fails', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('validation error when flagged by open ai', function () {
|
||||
test('validation error when flagged by open ai', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
Config::set(ValidationConstants::MODERATION_SERVICE_QUALIFIED, ModerationService::OPENAI->value);
|
||||
@@ -192,10 +193,10 @@ test('validation error when flagged by open ai', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('disposable email', function () {
|
||||
test('disposable email', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock) {
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('validate')->once()->andReturn(false);
|
||||
});
|
||||
|
||||
@@ -212,10 +213,10 @@ test('disposable email', function () {
|
||||
]);
|
||||
});
|
||||
|
||||
test('indisposable email', function () {
|
||||
test('indisposable email', function (): void {
|
||||
Notification::fake();
|
||||
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock) {
|
||||
$this->mock(Indisposable::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('validate')->once()->andReturn(true);
|
||||
});
|
||||
|
||||
@@ -240,7 +241,7 @@ test('indisposable email', function () {
|
||||
Notification::assertSentTimes(VerifyEmail::class, 1);
|
||||
});
|
||||
|
||||
test('email unique', function () {
|
||||
test('email unique', function (): void {
|
||||
$this->expectException(ValidationException::class);
|
||||
|
||||
$email = fake()->companyEmail();
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
use App\Actions\Models\Document\UpdatePageRelations;
|
||||
use App\Models\Document\Page;
|
||||
|
||||
test('associates next of previous page', function () {
|
||||
test('associates next of previous page', function (): void {
|
||||
$previous = Page::factory()->createOne();
|
||||
|
||||
$page = Page::factory()
|
||||
@@ -21,7 +21,7 @@ test('associates next of previous page', function () {
|
||||
$this->assertTrue($previous->next()->is($page));
|
||||
});
|
||||
|
||||
test('associates previous of next page', function () {
|
||||
test('associates previous of next page', function (): void {
|
||||
$next = Page::factory()->createOne();
|
||||
|
||||
$page = Page::factory()
|
||||
|
||||
@@ -6,10 +6,11 @@ use App\Actions\Models\List\Playlist\InsertTrackAfterAction;
|
||||
use App\Models\List\Playlist;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('last track', function () {
|
||||
test('last track', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(2, 9))
|
||||
->createOne();
|
||||
@@ -33,7 +34,7 @@ test('last track', function () {
|
||||
$this->assertTrue($track->next()->doesntExist());
|
||||
});
|
||||
|
||||
test('first track', function () {
|
||||
test('first track', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(2, 9))
|
||||
->createOne();
|
||||
|
||||
@@ -6,10 +6,11 @@ use App\Actions\Models\List\Playlist\InsertTrackBeforeAction;
|
||||
use App\Models\List\Playlist;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('first track', function () {
|
||||
test('first track', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(2, 9))
|
||||
->createOne();
|
||||
@@ -33,7 +34,7 @@ test('first track', function () {
|
||||
$this->assertTrue($track->previous()->doesntExist());
|
||||
});
|
||||
|
||||
test('last track', function () {
|
||||
test('last track', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(2, 9))
|
||||
->createOne();
|
||||
|
||||
@@ -7,7 +7,7 @@ use App\Models\List\Playlist;
|
||||
use App\Models\List\Playlist\PlaylistTrack;
|
||||
use App\Models\Wiki\Video;
|
||||
|
||||
test('first track', function () {
|
||||
test('first track', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
|
||||
$track = PlaylistTrack::factory()
|
||||
@@ -23,7 +23,7 @@ test('first track', function () {
|
||||
$this->assertTrue($playlist->last()->is($track));
|
||||
});
|
||||
|
||||
test('second track', function () {
|
||||
test('second track', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
|
||||
$first = PlaylistTrack::factory()
|
||||
@@ -51,7 +51,7 @@ test('second track', function () {
|
||||
$this->assertTrue($second->next()->doesntExist());
|
||||
});
|
||||
|
||||
test('third track', function () {
|
||||
test('third track', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
|
||||
$first = PlaylistTrack::factory()
|
||||
|
||||
@@ -4,10 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
use App\Actions\Models\List\Playlist\RemoveTrackAction;
|
||||
use App\Models\List\Playlist;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('remove sole', function () {
|
||||
test('remove sole', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(1)
|
||||
->createOne();
|
||||
@@ -25,7 +26,7 @@ test('remove sole', function () {
|
||||
$this->assertTrue($first->next()->doesntExist());
|
||||
});
|
||||
|
||||
test('remove first', function () {
|
||||
test('remove first', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(3, 9))
|
||||
->createOne();
|
||||
@@ -45,7 +46,7 @@ test('remove first', function () {
|
||||
$this->assertTrue($second->previous()->doesntExist());
|
||||
});
|
||||
|
||||
test('remove last', function () {
|
||||
test('remove last', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(fake()->numberBetween(3, 9))
|
||||
->createOne();
|
||||
@@ -65,7 +66,7 @@ test('remove last', function () {
|
||||
$this->assertTrue($previous->next()->doesntExist());
|
||||
});
|
||||
|
||||
test('remove second', function () {
|
||||
test('remove second', function (): void {
|
||||
$playlist = Playlist::factory()
|
||||
->tracks(3)
|
||||
->createOne();
|
||||
|
||||
@@ -6,14 +6,15 @@ use App\Actions\Models\Wiki\Image\OptimizeImageAction;
|
||||
use App\Constants\Config\ImageConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Image;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('skipped', function () {
|
||||
test('skipped', function (): void {
|
||||
$fs = Storage::fake(Config::get(ImageConstants::DISKS_QUALIFIED));
|
||||
$file = File::fake()->image(fake()->word().'.jpg');
|
||||
$fsFile = $fs->putFile('', $file);
|
||||
@@ -31,7 +32,7 @@ test('skipped', function () {
|
||||
$this->assertTrue($image->exists());
|
||||
});
|
||||
|
||||
test('converts to avif', function () {
|
||||
test('converts to avif', function (): void {
|
||||
$fs = Storage::fake(Config::get(ImageConstants::DISKS_QUALIFIED));
|
||||
$file = File::fake()->image(fake()->word().'.jpg');
|
||||
$fsFile = $fs->putFile('', $file);
|
||||
@@ -50,7 +51,7 @@ test('converts to avif', function () {
|
||||
$this->assertTrue($image->exists());
|
||||
});
|
||||
|
||||
test('downscale', function () {
|
||||
test('downscale', function (): void {
|
||||
$fs = Storage::fake(Config::get(ImageConstants::DISKS_QUALIFIED));
|
||||
$file = File::fake()->image(fake()->word().'.jpg');
|
||||
$fsFile = $fs->putFile('', $file);
|
||||
|
||||
@@ -12,13 +12,14 @@ use App\Models\Wiki\Anime\AnimeTheme;
|
||||
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Audio;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('skipped', function () {
|
||||
test('skipped', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -35,7 +36,7 @@ test('skipped', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('failed when no entries', function () {
|
||||
test('failed when no entries', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -50,7 +51,7 @@ test('failed when no entries', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('passes source video', function () {
|
||||
test('passes source video', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -74,7 +75,7 @@ test('passes source video', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('passes with higher priority source', function () {
|
||||
test('passes with higher priority source', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -103,7 +104,7 @@ test('passes with higher priority source', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('passes with primary version source', function () {
|
||||
test('passes with primary version source', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -8,18 +8,19 @@ use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Admin\Dump;
|
||||
use App\Repositories\Eloquent\Admin\DumpRepository as DumpDestinationRepository;
|
||||
use App\Repositories\Storage\Admin\DumpRepository as DumpSourceRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
test('no results', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -35,14 +36,14 @@ test('no results', function () {
|
||||
$this->assertDatabaseCount(Dump::class, 0);
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$createdDumpCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$dumps = Dump::factory()->count($createdDumpCount)->make();
|
||||
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock) use ($dumps) {
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock) use ($dumps): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($dumps);
|
||||
});
|
||||
|
||||
@@ -59,14 +60,14 @@ test('created', function () {
|
||||
$this->assertDatabaseCount(Dump::class, $createdDumpCount);
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$deletedDumpCount = fake()->numberBetween(2, 9);
|
||||
|
||||
Dump::factory()->count($deletedDumpCount)->create();
|
||||
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(DumpSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
|
||||
@@ -8,14 +8,15 @@ use App\Models\Wiki\Audio;
|
||||
use App\Repositories\Eloquent\Wiki\AudioRepository as AudioDestinationRepository;
|
||||
use App\Repositories\Storage\Wiki\AudioRepository;
|
||||
use App\Repositories\Storage\Wiki\AudioRepository as AudioSourceRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock) {
|
||||
test('no results', function (): void {
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -31,12 +32,12 @@ test('no results', function () {
|
||||
$this->assertDatabaseCount(Audio::class, 0);
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
$createdAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$audios = Audio::factory()->count($createdAudioCount)->make();
|
||||
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock) use ($audios) {
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock) use ($audios): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($audios);
|
||||
});
|
||||
|
||||
@@ -53,12 +54,12 @@ test('created', function () {
|
||||
$this->assertDatabaseCount(Audio::class, $createdAudioCount);
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
$deletedAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$audios = Audio::factory()->count($deletedAudioCount)->create();
|
||||
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(AudioSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -79,22 +80,22 @@ test('deleted', function () {
|
||||
}
|
||||
});
|
||||
|
||||
test('updated', function () {
|
||||
test('updated', function (): void {
|
||||
$updatedAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$basenames = collect(fake()->words($updatedAudioCount));
|
||||
|
||||
Audio::factory()
|
||||
->count($updatedAudioCount)
|
||||
->sequence(fn ($sequence) => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$sourceAudios = Audio::factory()
|
||||
->count($updatedAudioCount)
|
||||
->sequence(fn ($sequence) => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->make();
|
||||
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($sourceAudios) {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($sourceAudios): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($sourceAudios);
|
||||
});
|
||||
|
||||
|
||||
@@ -8,14 +8,15 @@ use App\Models\Wiki\Video;
|
||||
use App\Repositories\Eloquent\Wiki\VideoRepository as VideoDestinationRepository;
|
||||
use App\Repositories\Storage\Wiki\VideoRepository;
|
||||
use App\Repositories\Storage\Wiki\VideoRepository as VideoSourceRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock) {
|
||||
test('no results', function (): void {
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -31,12 +32,12 @@ test('no results', function () {
|
||||
$this->assertDatabaseCount(Video::class, 0);
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
$createdVideoCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$videos = Video::factory()->count($createdVideoCount)->make();
|
||||
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock) use ($videos) {
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock) use ($videos): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($videos);
|
||||
});
|
||||
|
||||
@@ -53,12 +54,12 @@ test('created', function () {
|
||||
$this->assertDatabaseCount(Video::class, $createdVideoCount);
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
$deletedVideoCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$videos = Video::factory()->count($deletedVideoCount)->create();
|
||||
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(VideoSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -79,22 +80,22 @@ test('deleted', function () {
|
||||
}
|
||||
});
|
||||
|
||||
test('updated', function () {
|
||||
test('updated', function (): void {
|
||||
$updatedVideoCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$basenames = collect(fake()->words($updatedVideoCount));
|
||||
|
||||
Video::factory()
|
||||
->count($updatedVideoCount)
|
||||
->sequence(fn ($sequence) => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$sourceVideos = Video::factory()
|
||||
->count($updatedVideoCount)
|
||||
->sequence(fn ($sequence) => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->make();
|
||||
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($sourceVideos) {
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($sourceVideos): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($sourceVideos);
|
||||
});
|
||||
|
||||
|
||||
+8
-7
@@ -7,14 +7,15 @@ use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use App\Repositories\Eloquent\Wiki\Video\ScriptRepository as ScriptDestinationRepository;
|
||||
use App\Repositories\Storage\Wiki\Video\ScriptRepository as ScriptSourceRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock) {
|
||||
test('no results', function (): void {
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -30,12 +31,12 @@ test('no results', function () {
|
||||
$this->assertDatabaseCount(VideoScript::class, 0);
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
$createdScriptCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$scripts = VideoScript::factory()->count($createdScriptCount)->make();
|
||||
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock) use ($scripts) {
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock) use ($scripts): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($scripts);
|
||||
});
|
||||
|
||||
@@ -52,12 +53,12 @@ test('created', function () {
|
||||
$this->assertDatabaseCount(VideoScript::class, $createdScriptCount);
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
$deletedScriptCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$scripts = VideoScript::factory()->count($deletedScriptCount)->create();
|
||||
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(ScriptSourceRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ use App\Actions\Storage\Admin\Dump\DumpDocumentAction;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Admin\Dump;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ use App\Actions\Storage\Admin\Dump\DumpContentAction;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Admin\Dump;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@ use App\Actions\Storage\Admin\Dump\PruneDumpAction;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Admin\Dump;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
test('no results', function (): void {
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$action = new PruneDumpAction(fake()->numberBetween(2, 9));
|
||||
@@ -28,12 +29,12 @@ test('no results', function () {
|
||||
$this->assertDatabaseCount(Dump::class, 0);
|
||||
});
|
||||
|
||||
test('pruned', function () {
|
||||
test('pruned', function (): void {
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$prunedCount = fake()->randomDigitNotNull();
|
||||
|
||||
Collection::times($prunedCount, function () {
|
||||
Collection::times($prunedCount, function (): void {
|
||||
Date::setTestNow(fake()->iso8601());
|
||||
|
||||
$action = new DumpContentAction();
|
||||
|
||||
@@ -6,15 +6,16 @@ use App\Actions\Storage\Wiki\Audio\DeleteAudioAction;
|
||||
use App\Constants\Config\AudioConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Audio;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Http\Testing\MimeType;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\File as FileFacade;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -29,7 +30,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -51,7 +52,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('deleted from disk', function () {
|
||||
test('deleted from disk', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -71,7 +72,7 @@ test('deleted from disk', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('audio deleted', function () {
|
||||
test('audio deleted', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Constants\Config\AudioConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Audio;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Http\Testing\MimeType;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
@@ -14,9 +15,9 @@ use Illuminate\Support\Facades\File as FileFacade;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -31,7 +32,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
@@ -56,7 +57,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('moved in disk', function () {
|
||||
test('moved in disk', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
@@ -83,7 +84,7 @@ test('moved in disk', function () {
|
||||
$fs->assertExists($to);
|
||||
});
|
||||
|
||||
test('audio updated', function () {
|
||||
test('audio updated', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -6,13 +6,14 @@ use App\Actions\Storage\Wiki\Audio\UploadAudioAction;
|
||||
use App\Constants\Config\AudioConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Audio;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -27,7 +28,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -42,7 +43,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('uploaded to disk', function () {
|
||||
test('uploaded to disk', function (): void {
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -55,7 +56,7 @@ test('uploaded to disk', function () {
|
||||
$this->assertCount(1, Storage::disk(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('created audio', function () {
|
||||
test('created audio', function (): void {
|
||||
Storage::fake(Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(AudioConstants::DISKS_QUALIFIED, [Config::get(AudioConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
|
||||
@@ -6,15 +6,16 @@ use App\Actions\Storage\Wiki\Video\DeleteVideoAction;
|
||||
use App\Constants\Config\VideoConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Http\Testing\MimeType;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\File as FileFacade;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -29,7 +30,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -51,7 +52,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('deleted from disk', function () {
|
||||
test('deleted from disk', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -71,7 +72,7 @@ test('deleted from disk', function () {
|
||||
$this->assertEmpty(Storage::disk(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('video deleted', function () {
|
||||
test('video deleted', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Constants\Config\VideoConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Http\Testing\MimeType;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
@@ -14,9 +15,9 @@ use Illuminate\Support\Facades\File as FileFacade;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -31,7 +32,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
@@ -56,7 +57,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('moved in disk', function () {
|
||||
test('moved in disk', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
@@ -83,7 +84,7 @@ test('moved in disk', function () {
|
||||
$fs->assertExists($to);
|
||||
});
|
||||
|
||||
test('video updated', function () {
|
||||
test('video updated', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -6,13 +6,14 @@ use App\Actions\Storage\Wiki\Video\Script\DeleteScriptAction;
|
||||
use App\Constants\Config\VideoConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::SCRIPT_DISK_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -27,7 +28,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
@@ -45,7 +46,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('deleted from disk', function () {
|
||||
test('deleted from disk', function (): void {
|
||||
$fs = Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
@@ -61,7 +62,7 @@ test('deleted from disk', function () {
|
||||
$this->assertEmpty($fs->allFiles());
|
||||
});
|
||||
|
||||
test('video deleted', function () {
|
||||
test('video deleted', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
|
||||
@@ -7,14 +7,15 @@ use App\Constants\Config\VideoConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::SCRIPT_DISK_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -29,7 +30,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -50,7 +51,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('moved in disk', function () {
|
||||
test('moved in disk', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -73,7 +74,7 @@ test('moved in disk', function () {
|
||||
$fs->assertExists($to);
|
||||
});
|
||||
|
||||
test('script updated', function () {
|
||||
test('script updated', function (): void {
|
||||
/** @var FilesystemAdapter $fs */
|
||||
$fs = Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@ use App\Constants\Config\VideoConstants;
|
||||
use App\Enums\Actions\ActionStatus;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::SCRIPT_DISK_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -28,7 +29,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
@@ -42,7 +43,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('uploaded to disk', function () {
|
||||
test('uploaded to disk', function (): void {
|
||||
$fs = Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
@@ -54,7 +55,7 @@ test('uploaded to disk', function () {
|
||||
$this->assertCount(1, $fs->allFiles());
|
||||
});
|
||||
|
||||
test('created video', function () {
|
||||
test('created video', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
@@ -68,7 +69,7 @@ test('created video', function () {
|
||||
$this->assertDatabaseCount(VideoScript::class, 1);
|
||||
});
|
||||
|
||||
test('attaches video', function () {
|
||||
test('attaches video', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$file = File::fake()->create(fake()->word().'.txt', fake()->randomDigitNotNull());
|
||||
|
||||
@@ -14,15 +14,16 @@ use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use App\Pivots\Wiki\AnimeThemeEntryVideo;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Http\Testing\File;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('default', function () {
|
||||
test('default', function (): void {
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, []);
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
@@ -37,7 +38,7 @@ test('default', function () {
|
||||
$this->assertTrue($result->hasFailed());
|
||||
});
|
||||
|
||||
test('passed', function () {
|
||||
test('passed', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -52,7 +53,7 @@ test('passed', function () {
|
||||
$this->assertTrue($result->getStatus() === ActionStatus::PASSED);
|
||||
});
|
||||
|
||||
test('uploaded to disk', function () {
|
||||
test('uploaded to disk', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -65,7 +66,7 @@ test('uploaded to disk', function () {
|
||||
$this->assertCount(1, Storage::disk(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED))->allFiles());
|
||||
});
|
||||
|
||||
test('created video', function () {
|
||||
test('created video', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -90,7 +91,7 @@ test('created video', function () {
|
||||
$this->assertDatabaseCount(Video::class, 1);
|
||||
});
|
||||
|
||||
test('sets attributes', function () {
|
||||
test('sets attributes', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -127,7 +128,7 @@ test('sets attributes', function () {
|
||||
$this->assertDatabaseHas(Video::class, $attributes);
|
||||
});
|
||||
|
||||
test('attaches entry', function () {
|
||||
test('attaches entry', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
|
||||
@@ -156,7 +157,7 @@ test('attaches entry', function () {
|
||||
$this->assertDatabaseCount(AnimeThemeEntryVideo::class, 1);
|
||||
});
|
||||
|
||||
test('associates script', function () {
|
||||
test('associates script', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
Config::set(VideoConstants::DISKS_QUALIFIED, [Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED)]);
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
@@ -6,15 +6,16 @@ use App\Console\Commands\Repositories\Storage\Admin\DumpReconcileCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use App\Models\Admin\Dump;
|
||||
use App\Repositories\Storage\Admin\DumpRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock) {
|
||||
test('no results', function (): void {
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -23,14 +24,14 @@ test('no results', function () {
|
||||
->expectsOutput('No Dumps created or deleted or updated');
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$createdDumpCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$dumps = Dump::factory()->count($createdDumpCount)->make();
|
||||
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock) use ($dumps) {
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock) use ($dumps): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($dumps);
|
||||
});
|
||||
|
||||
@@ -39,14 +40,14 @@ test('created', function () {
|
||||
->expectsOutput("$createdDumpCount Dumps created, 0 Dumps deleted, 0 Dumps updated");
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$deletedDumpCount = fake()->numberBetween(2, 9);
|
||||
|
||||
Dump::factory()->count($deletedDumpCount)->create();
|
||||
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(DumpRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ declare(strict_types=1);
|
||||
use App\Console\Commands\Repositories\Storage\Wiki\AudioReconcileCommand;
|
||||
use App\Models\Wiki\Audio;
|
||||
use App\Repositories\Storage\Wiki\AudioRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) {
|
||||
test('no results', function (): void {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -20,12 +21,12 @@ test('no results', function () {
|
||||
->expectsOutput('No Audio created or deleted or updated');
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
$createdAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$audios = Audio::factory()->count($createdAudioCount)->make();
|
||||
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($audios) {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($audios): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($audios);
|
||||
});
|
||||
|
||||
@@ -34,12 +35,12 @@ test('created', function () {
|
||||
->expectsOutput("$createdAudioCount Audio created, 0 Audio deleted, 0 Audio updated");
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
$deletedAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
Audio::factory()->count($deletedAudioCount)->create();
|
||||
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -48,22 +49,22 @@ test('deleted', function () {
|
||||
->expectsOutput("0 Audio created, $deletedAudioCount Audio deleted, 0 Audio updated");
|
||||
});
|
||||
|
||||
test('updated', function () {
|
||||
test('updated', function (): void {
|
||||
$updatedAudioCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$basenames = collect(fake()->words($updatedAudioCount));
|
||||
|
||||
Audio::factory()
|
||||
->count($updatedAudioCount)
|
||||
->sequence(fn ($sequence) => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$sourceAudios = Audio::factory()
|
||||
->count($updatedAudioCount)
|
||||
->sequence(fn ($sequence) => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Audio::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($sourceAudios) {
|
||||
$this->mock(AudioRepository::class, function (MockInterface $mock) use ($sourceAudios): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($sourceAudios);
|
||||
});
|
||||
|
||||
|
||||
+8
-7
@@ -6,17 +6,18 @@ use App\Console\Commands\Repositories\Storage\Wiki\Video\ScriptReconcileCommand;
|
||||
use App\Constants\Config\VideoConstants;
|
||||
use App\Models\Wiki\Video\VideoScript;
|
||||
use App\Repositories\Storage\Wiki\Video\ScriptRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
test('no results', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -25,14 +26,14 @@ test('no results', function () {
|
||||
->expectsOutput('No Video Scripts created or deleted or updated');
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$createdScriptCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$scripts = VideoScript::factory()->count($createdScriptCount)->make();
|
||||
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock) use ($scripts) {
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock) use ($scripts): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($scripts);
|
||||
});
|
||||
|
||||
@@ -41,14 +42,14 @@ test('created', function () {
|
||||
->expectsOutput("$createdScriptCount Video Scripts created, 0 Video Scripts deleted, 0 Video Scripts updated");
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::SCRIPT_DISK_QUALIFIED));
|
||||
|
||||
$deletedScriptCount = fake()->numberBetween(2, 9);
|
||||
|
||||
VideoScript::factory()->count($deletedScriptCount)->create();
|
||||
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(ScriptRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
|
||||
@@ -6,17 +6,18 @@ use App\Console\Commands\Repositories\Storage\Wiki\VideoReconcileCommand;
|
||||
use App\Constants\Config\VideoConstants;
|
||||
use App\Models\Wiki\Video;
|
||||
use App\Repositories\Storage\Wiki\VideoRepository;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Mockery\MockInterface;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
test('no results', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -25,14 +26,14 @@ test('no results', function () {
|
||||
->expectsOutput('No Videos created or deleted or updated');
|
||||
});
|
||||
|
||||
test('created', function () {
|
||||
test('created', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
$createdVideoCount = fake()->numberBetween(2, 9);
|
||||
|
||||
$videos = Video::factory()->count($createdVideoCount)->make();
|
||||
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($videos) {
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($videos): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($videos);
|
||||
});
|
||||
|
||||
@@ -41,14 +42,14 @@ test('created', function () {
|
||||
->expectsOutput("$createdVideoCount Videos created, 0 Videos deleted, 0 Videos updated");
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
$deletedVideoCount = fake()->numberBetween(2, 9);
|
||||
|
||||
Video::factory()->count($deletedVideoCount)->create();
|
||||
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) {
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn(Collection::make());
|
||||
});
|
||||
|
||||
@@ -57,7 +58,7 @@ test('deleted', function () {
|
||||
->expectsOutput("0 Videos created, $deletedVideoCount Videos deleted, 0 Videos updated");
|
||||
});
|
||||
|
||||
test('updated', function () {
|
||||
test('updated', function (): void {
|
||||
Storage::fake(Config::get(VideoConstants::DEFAULT_DISK_QUALIFIED));
|
||||
|
||||
$updatedVideoCount = fake()->numberBetween(2, 9);
|
||||
@@ -66,15 +67,15 @@ test('updated', function () {
|
||||
|
||||
Video::factory()
|
||||
->count($updatedVideoCount)
|
||||
->sequence(fn ($sequence) => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$sourceVideos = Video::factory()
|
||||
->count($updatedVideoCount)
|
||||
->sequence(fn ($sequence) => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->sequence(fn ($sequence): array => [Video::ATTRIBUTE_BASENAME => $basenames->get($sequence->index)])
|
||||
->create();
|
||||
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($sourceVideos) {
|
||||
$this->mock(VideoRepository::class, function (MockInterface $mock) use ($sourceVideos): void {
|
||||
$mock->shouldReceive('get')->once()->andReturn($sourceVideos);
|
||||
});
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\AdminDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\AuthDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\DiscordDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\DocumentDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@ declare(strict_types=1);
|
||||
use App\Actions\Storage\Admin\Dump\DumpContentAction;
|
||||
use App\Console\Commands\Storage\Admin\DumpPruneCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('no results', function () {
|
||||
test('no results', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$this->artisan(DumpPruneCommand::class, ['--hours' => 0])
|
||||
@@ -20,12 +21,12 @@ test('no results', function () {
|
||||
->expectsOutput('No prunings were attempted.');
|
||||
});
|
||||
|
||||
test('deleted', function () {
|
||||
test('deleted', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
$prunedCount = fake()->randomDigitNotNull();
|
||||
|
||||
Collection::times($prunedCount, function () {
|
||||
Collection::times($prunedCount, function (): void {
|
||||
Date::setTestNow(fake()->iso8601());
|
||||
|
||||
$action = new DumpContentAction();
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\ListDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\UserDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake('local');
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
@@ -21,7 +22,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
use App\Console\Commands\Storage\Admin\ContentDumpCommand;
|
||||
use App\Constants\Config\DumpConstants;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
uses(Illuminate\Foundation\Testing\WithFaker::class);
|
||||
uses(WithFaker::class);
|
||||
|
||||
test('database dump output', function () {
|
||||
test('database dump output', function (): void {
|
||||
Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
Date::setTestNow(fake()->iso8601());
|
||||
@@ -20,7 +21,7 @@ test('database dump output', function () {
|
||||
->expectsOutputToContain('has been created');
|
||||
});
|
||||
|
||||
test('database dump file', function () {
|
||||
test('database dump file', function (): void {
|
||||
$local = Storage::fake('local');
|
||||
$fs = Storage::fake(Config::get(DumpConstants::DISK_QUALIFIED));
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ use App\Models\Admin\Announcement;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('announcement created event dispatched', function () {
|
||||
test('announcement created event dispatched', function (): void {
|
||||
Announcement::factory()->create();
|
||||
|
||||
Event::assertDispatched(AnnouncementCreated::class);
|
||||
});
|
||||
|
||||
test('announcement deleted event dispatched', function () {
|
||||
test('announcement deleted event dispatched', function (): void {
|
||||
$announcement = Announcement::factory()->create();
|
||||
|
||||
$announcement->delete();
|
||||
@@ -23,7 +23,7 @@ test('announcement deleted event dispatched', function () {
|
||||
Event::assertDispatched(AnnouncementDeleted::class);
|
||||
});
|
||||
|
||||
test('announcement updated event dispatched', function () {
|
||||
test('announcement updated event dispatched', function (): void {
|
||||
$announcement = Announcement::factory()->createOne();
|
||||
$changes = Announcement::factory()->makeOne();
|
||||
|
||||
@@ -33,16 +33,16 @@ test('announcement updated event dispatched', function () {
|
||||
Event::assertDispatched(AnnouncementUpdated::class);
|
||||
});
|
||||
|
||||
test('announcement updated event embed fields', function () {
|
||||
test('announcement updated event embed fields', function (): void {
|
||||
$announcement = Announcement::factory()->createOne();
|
||||
$changes = Announcement::factory()->makeOne();
|
||||
|
||||
$announcement->fill($changes->getAttributes());
|
||||
$announcement->save();
|
||||
|
||||
Event::assertDispatched(AnnouncementUpdated::class, function (AnnouncementUpdated $event) {
|
||||
Event::assertDispatched(AnnouncementUpdated::class, function (AnnouncementUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,13 +9,13 @@ use App\Models\Admin\Dump;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('dump created event dispatched', function () {
|
||||
test('dump created event dispatched', function (): void {
|
||||
Dump::factory()->create();
|
||||
|
||||
Event::assertDispatched(DumpCreated::class);
|
||||
});
|
||||
|
||||
test('dump deleted event dispatched', function () {
|
||||
test('dump deleted event dispatched', function (): void {
|
||||
$dump = Dump::factory()->create();
|
||||
|
||||
$dump->delete();
|
||||
@@ -23,7 +23,7 @@ test('dump deleted event dispatched', function () {
|
||||
Event::assertDispatched(DumpDeleted::class);
|
||||
});
|
||||
|
||||
test('dump updated event dispatched', function () {
|
||||
test('dump updated event dispatched', function (): void {
|
||||
$dump = Dump::factory()->createOne();
|
||||
$changes = Dump::factory()->makeOne();
|
||||
|
||||
@@ -33,16 +33,16 @@ test('dump updated event dispatched', function () {
|
||||
Event::assertDispatched(DumpUpdated::class);
|
||||
});
|
||||
|
||||
test('dump updated event embed fields', function () {
|
||||
test('dump updated event embed fields', function (): void {
|
||||
$dump = Dump::factory()->createOne();
|
||||
$changes = Dump::factory()->makeOne();
|
||||
|
||||
$dump->fill($changes->getAttributes());
|
||||
$dump->save();
|
||||
|
||||
Event::assertDispatched(DumpUpdated::class, function (DumpUpdated $event) {
|
||||
Event::assertDispatched(DumpUpdated::class, function (DumpUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,13 +9,13 @@ use App\Models\Admin\Feature;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('feature created event dispatched', function () {
|
||||
test('feature created event dispatched', function (): void {
|
||||
Feature::factory()->create();
|
||||
|
||||
Event::assertDispatched(FeatureCreated::class);
|
||||
});
|
||||
|
||||
test('feature deleted event dispatched', function () {
|
||||
test('feature deleted event dispatched', function (): void {
|
||||
$feature = Feature::factory()->create();
|
||||
|
||||
$feature->delete();
|
||||
@@ -23,7 +23,7 @@ test('feature deleted event dispatched', function () {
|
||||
Event::assertDispatched(FeatureDeleted::class);
|
||||
});
|
||||
|
||||
test('feature updated event dispatched', function () {
|
||||
test('feature updated event dispatched', function (): void {
|
||||
$feature = Feature::factory()->createOne();
|
||||
|
||||
$feature->update([
|
||||
@@ -33,16 +33,16 @@ test('feature updated event dispatched', function () {
|
||||
Event::assertDispatched(FeatureUpdated::class);
|
||||
});
|
||||
|
||||
test('feature updated event embed fields', function () {
|
||||
test('feature updated event embed fields', function (): void {
|
||||
$feature = Feature::factory()->createOne();
|
||||
|
||||
$feature->update([
|
||||
Feature::ATTRIBUTE_VALUE => ! $feature->value,
|
||||
]);
|
||||
|
||||
Event::assertDispatched(FeatureUpdated::class, function (FeatureUpdated $event) {
|
||||
Event::assertDispatched(FeatureUpdated::class, function (FeatureUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,13 +9,13 @@ use App\Models\Admin\FeaturedTheme;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('featured theme created event dispatched', function () {
|
||||
test('featured theme created event dispatched', function (): void {
|
||||
FeaturedTheme::factory()->create();
|
||||
|
||||
Event::assertDispatched(FeaturedThemeCreated::class);
|
||||
});
|
||||
|
||||
test('featured theme deleted event dispatched', function () {
|
||||
test('featured theme deleted event dispatched', function (): void {
|
||||
$featuredTheme = FeaturedTheme::factory()->create();
|
||||
|
||||
$featuredTheme->delete();
|
||||
@@ -23,7 +23,7 @@ test('featured theme deleted event dispatched', function () {
|
||||
Event::assertDispatched(FeaturedThemeDeleted::class);
|
||||
});
|
||||
|
||||
test('featured theme updated event dispatched', function () {
|
||||
test('featured theme updated event dispatched', function (): void {
|
||||
$featuredTheme = FeaturedTheme::factory()->createOne();
|
||||
$changes = FeaturedTheme::factory()->makeOne();
|
||||
|
||||
@@ -33,16 +33,16 @@ test('featured theme updated event dispatched', function () {
|
||||
Event::assertDispatched(FeaturedThemeUpdated::class);
|
||||
});
|
||||
|
||||
test('featured theme updated event embed fields', function () {
|
||||
test('featured theme updated event embed fields', function (): void {
|
||||
$featuredTheme = FeaturedTheme::factory()->createOne();
|
||||
$changes = FeaturedTheme::factory()->makeOne();
|
||||
|
||||
$featuredTheme->fill($changes->getAttributes());
|
||||
$featuredTheme->save();
|
||||
|
||||
Event::assertDispatched(FeaturedThemeUpdated::class, function (FeaturedThemeUpdated $event) {
|
||||
Event::assertDispatched(FeaturedThemeUpdated::class, function (FeaturedThemeUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Auth\User;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('user created event dispatched', function () {
|
||||
test('user created event dispatched', function (): void {
|
||||
User::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(UserCreated::class);
|
||||
});
|
||||
|
||||
test('user deleted event dispatched', function () {
|
||||
test('user deleted event dispatched', function (): void {
|
||||
$user = User::factory()->createOne();
|
||||
|
||||
$user->delete();
|
||||
@@ -24,7 +24,7 @@ test('user deleted event dispatched', function () {
|
||||
Event::assertDispatched(UserDeleted::class);
|
||||
});
|
||||
|
||||
test('user restored event dispatched', function () {
|
||||
test('user restored event dispatched', function (): void {
|
||||
$user = User::factory()->createOne();
|
||||
|
||||
$user->restore();
|
||||
@@ -32,7 +32,7 @@ test('user restored event dispatched', function () {
|
||||
Event::assertDispatched(UserRestored::class);
|
||||
});
|
||||
|
||||
test('user restores quietly', function () {
|
||||
test('user restores quietly', function (): void {
|
||||
$user = User::factory()->createOne();
|
||||
|
||||
$user->restore();
|
||||
@@ -40,7 +40,7 @@ test('user restores quietly', function () {
|
||||
Event::assertNotDispatched(UserUpdated::class);
|
||||
});
|
||||
|
||||
test('user updated event dispatched', function () {
|
||||
test('user updated event dispatched', function (): void {
|
||||
$user = User::factory()->createOne();
|
||||
$changes = User::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('user updated event dispatched', function () {
|
||||
Event::assertDispatched(UserUpdated::class);
|
||||
});
|
||||
|
||||
test('user updated event embed fields', function () {
|
||||
test('user updated event embed fields', function (): void {
|
||||
$user = User::factory()->createOne();
|
||||
$changes = User::factory()->makeOne();
|
||||
|
||||
$user->fill($changes->getAttributes());
|
||||
$user->save();
|
||||
|
||||
Event::assertDispatched(UserUpdated::class, function (UserUpdated $event) {
|
||||
Event::assertDispatched(UserUpdated::class, function (UserUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Document\Page;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('page created event dispatched', function () {
|
||||
test('page created event dispatched', function (): void {
|
||||
Page::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(PageCreated::class);
|
||||
});
|
||||
|
||||
test('page deleted event dispatched', function () {
|
||||
test('page deleted event dispatched', function (): void {
|
||||
$page = Page::factory()->createOne();
|
||||
|
||||
$page->delete();
|
||||
@@ -24,7 +24,7 @@ test('page deleted event dispatched', function () {
|
||||
Event::assertDispatched(PageDeleted::class);
|
||||
});
|
||||
|
||||
test('page restored event dispatched', function () {
|
||||
test('page restored event dispatched', function (): void {
|
||||
$page = Page::factory()->createOne();
|
||||
|
||||
$page->restore();
|
||||
@@ -32,7 +32,7 @@ test('page restored event dispatched', function () {
|
||||
Event::assertDispatched(PageRestored::class);
|
||||
});
|
||||
|
||||
test('page restores quietly', function () {
|
||||
test('page restores quietly', function (): void {
|
||||
$page = Page::factory()->createOne();
|
||||
|
||||
$page->restore();
|
||||
@@ -40,7 +40,7 @@ test('page restores quietly', function () {
|
||||
Event::assertNotDispatched(PageUpdated::class);
|
||||
});
|
||||
|
||||
test('page updated event dispatched', function () {
|
||||
test('page updated event dispatched', function (): void {
|
||||
$page = Page::factory()->createOne();
|
||||
$changes = Page::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('page updated event dispatched', function () {
|
||||
Event::assertDispatched(PageUpdated::class);
|
||||
});
|
||||
|
||||
test('page updated event embed fields', function () {
|
||||
test('page updated event embed fields', function (): void {
|
||||
$page = Page::factory()->createOne();
|
||||
$changes = Page::factory()->makeOne();
|
||||
|
||||
$page->fill($changes->getAttributes());
|
||||
$page->save();
|
||||
|
||||
Event::assertDispatched(PageUpdated::class, function (PageUpdated $event) {
|
||||
Event::assertDispatched(PageUpdated::class, function (PageUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,13 +9,13 @@ use App\Models\List\ExternalProfile;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('external profile created event dispatched', function () {
|
||||
test('external profile created event dispatched', function (): void {
|
||||
ExternalProfile::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(ExternalProfileCreated::class);
|
||||
});
|
||||
|
||||
test('external profile deleted event dispatched', function () {
|
||||
test('external profile deleted event dispatched', function (): void {
|
||||
$profile = ExternalProfile::factory()->createOne();
|
||||
|
||||
$profile->delete();
|
||||
@@ -23,7 +23,7 @@ test('external profile deleted event dispatched', function () {
|
||||
Event::assertDispatched(ExternalProfileDeleted::class);
|
||||
});
|
||||
|
||||
test('external profile updated event dispatched', function () {
|
||||
test('external profile updated event dispatched', function (): void {
|
||||
$profile = ExternalProfile::factory()->createOne();
|
||||
$changes = ExternalProfile::factory()->makeOne();
|
||||
|
||||
@@ -33,16 +33,16 @@ test('external profile updated event dispatched', function () {
|
||||
Event::assertDispatched(ExternalProfileUpdated::class);
|
||||
});
|
||||
|
||||
test('external profile updated event embed fields', function () {
|
||||
test('external profile updated event embed fields', function (): void {
|
||||
$profile = ExternalProfile::factory()->createOne();
|
||||
$changes = ExternalProfile::factory()->makeOne();
|
||||
|
||||
$profile->fill($changes->getAttributes());
|
||||
$profile->save();
|
||||
|
||||
Event::assertDispatched(ExternalProfileUpdated::class, function (ExternalProfileUpdated $event) {
|
||||
Event::assertDispatched(ExternalProfileUpdated::class, function (ExternalProfileUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Models\List\Playlist\PlaylistTrack;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('track created event dispatched', function () {
|
||||
test('track created event dispatched', function (): void {
|
||||
PlaylistTrack::factory()
|
||||
->for(Playlist::factory())
|
||||
->createOne();
|
||||
@@ -19,7 +19,7 @@ test('track created event dispatched', function () {
|
||||
Event::assertDispatched(TrackCreated::class);
|
||||
});
|
||||
|
||||
test('track deleted event dispatched', function () {
|
||||
test('track deleted event dispatched', function (): void {
|
||||
$track = PlaylistTrack::factory()
|
||||
->for(Playlist::factory())
|
||||
->createOne();
|
||||
@@ -29,7 +29,7 @@ test('track deleted event dispatched', function () {
|
||||
Event::assertDispatched(TrackDeleted::class);
|
||||
});
|
||||
|
||||
test('track updated event dispatched', function () {
|
||||
test('track updated event dispatched', function (): void {
|
||||
$track = PlaylistTrack::factory()
|
||||
->for(Playlist::factory())
|
||||
->createOne();
|
||||
@@ -44,7 +44,7 @@ test('track updated event dispatched', function () {
|
||||
Event::assertDispatched(TrackUpdated::class);
|
||||
});
|
||||
|
||||
test('playlist updated event embed fields', function () {
|
||||
test('playlist updated event embed fields', function (): void {
|
||||
$track = PlaylistTrack::factory()
|
||||
->for(Playlist::factory())
|
||||
->createOne();
|
||||
@@ -56,14 +56,14 @@ test('playlist updated event embed fields', function () {
|
||||
$track->fill($changes->getAttributes());
|
||||
$track->save();
|
||||
|
||||
Event::assertDispatched(TrackUpdated::class, function (TrackUpdated $event) {
|
||||
Event::assertDispatched(TrackUpdated::class, function (TrackUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
test('playlist created assigns hashids', function () {
|
||||
test('playlist created assigns hashids', function (): void {
|
||||
Event::fakeExcept(TrackCreated::class);
|
||||
|
||||
PlaylistTrack::factory()
|
||||
|
||||
@@ -11,13 +11,13 @@ use App\Models\List\Playlist;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('playlist created event dispatched', function () {
|
||||
test('playlist created event dispatched', function (): void {
|
||||
Playlist::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(PlaylistCreated::class);
|
||||
});
|
||||
|
||||
test('playlist deleted event dispatched', function () {
|
||||
test('playlist deleted event dispatched', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
|
||||
$playlist->delete();
|
||||
@@ -25,7 +25,7 @@ test('playlist deleted event dispatched', function () {
|
||||
Event::assertDispatched(PlaylistDeleted::class);
|
||||
});
|
||||
|
||||
test('playlist updated event dispatched', function () {
|
||||
test('playlist updated event dispatched', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
$changes = Playlist::factory()->makeOne();
|
||||
|
||||
@@ -35,21 +35,21 @@ test('playlist updated event dispatched', function () {
|
||||
Event::assertDispatched(PlaylistUpdated::class);
|
||||
});
|
||||
|
||||
test('playlist updated event embed fields', function () {
|
||||
test('playlist updated event embed fields', function (): void {
|
||||
$playlist = Playlist::factory()->createOne();
|
||||
$changes = Playlist::factory()->makeOne();
|
||||
|
||||
$playlist->fill($changes->getAttributes());
|
||||
$playlist->save();
|
||||
|
||||
Event::assertDispatched(PlaylistUpdated::class, function (PlaylistUpdated $event) {
|
||||
Event::assertDispatched(PlaylistUpdated::class, function (PlaylistUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
test('playlist created assigns nullable user hashids', function () {
|
||||
test('playlist created assigns nullable user hashids', function (): void {
|
||||
Event::fakeExcept(PlaylistCreated::class);
|
||||
|
||||
Playlist::factory()->createOne();
|
||||
@@ -57,7 +57,7 @@ test('playlist created assigns nullable user hashids', function () {
|
||||
$this->assertDatabaseMissing(Playlist::class, [HasHashids::ATTRIBUTE_HASHID => null]);
|
||||
});
|
||||
|
||||
test('playlist created assigns non null user hashids', function () {
|
||||
test('playlist created assigns non null user hashids', function (): void {
|
||||
Event::fakeExcept(PlaylistCreated::class);
|
||||
|
||||
Playlist::factory()
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Pivots\Morph\Imageable;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('imageable created event dispatched', function () {
|
||||
test('imageable created event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Imageable::$imageables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -21,7 +21,7 @@ test('imageable created event dispatched', function () {
|
||||
Event::assertDispatched(ImageableCreated::class);
|
||||
});
|
||||
|
||||
test('imageable deleted event dispatched', function () {
|
||||
test('imageable deleted event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Imageable::$imageables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -33,7 +33,7 @@ test('imageable deleted event dispatched', function () {
|
||||
Event::assertDispatched(ImageableDeleted::class);
|
||||
});
|
||||
|
||||
test('imageable updated event dispatched', function () {
|
||||
test('imageable updated event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Imageable::$imageables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -55,7 +55,7 @@ test('imageable updated event dispatched', function () {
|
||||
Event::assertDispatched(ImageableUpdated::class);
|
||||
});
|
||||
|
||||
test('imageable updated event embed fields', function () {
|
||||
test('imageable updated event embed fields', function (): void {
|
||||
$modelClass = Arr::random(Imageable::$imageables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -74,9 +74,9 @@ test('imageable updated event embed fields', function () {
|
||||
$imageable->fill($changes->getAttributes());
|
||||
$imageable->save();
|
||||
|
||||
Event::assertDispatched(ImageableUpdated::class, function (ImageableUpdated $event) {
|
||||
Event::assertDispatched(ImageableUpdated::class, function (ImageableUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Pivots\Morph\Resourceable;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('resourceable created event dispatched', function () {
|
||||
test('resourceable created event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Resourceable::$resourceables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -21,7 +21,7 @@ test('resourceable created event dispatched', function () {
|
||||
Event::assertDispatched(ResourceableCreated::class);
|
||||
});
|
||||
|
||||
test('resourceable deleted event dispatched', function () {
|
||||
test('resourceable deleted event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Resourceable::$resourceables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -33,7 +33,7 @@ test('resourceable deleted event dispatched', function () {
|
||||
Event::assertDispatched(ResourceableDeleted::class);
|
||||
});
|
||||
|
||||
test('resourceable updated event dispatched', function () {
|
||||
test('resourceable updated event dispatched', function (): void {
|
||||
$modelClass = Arr::random(Resourceable::$resourceables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -55,7 +55,7 @@ test('resourceable updated event dispatched', function () {
|
||||
Event::assertDispatched(ResourceableUpdated::class);
|
||||
});
|
||||
|
||||
test('resourceable updated event embed fields', function () {
|
||||
test('resourceable updated event embed fields', function (): void {
|
||||
$modelClass = Arr::random(Resourceable::$resourceables);
|
||||
|
||||
$model = $modelClass::factory()->createOne();
|
||||
@@ -74,9 +74,9 @@ test('resourceable updated event embed fields', function () {
|
||||
$resourceable->fill($changes->getAttributes());
|
||||
$resourceable->save();
|
||||
|
||||
Event::assertDispatched(ResourceableUpdated::class, function (ResourceableUpdated $event) {
|
||||
Event::assertDispatched(ResourceableUpdated::class, function (ResourceableUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Series;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('anime series created event dispatched', function () {
|
||||
test('anime series created event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$series = Series::factory()->createOne();
|
||||
|
||||
@@ -17,7 +17,7 @@ test('anime series created event dispatched', function () {
|
||||
Event::assertDispatched(AnimeSeriesCreated::class);
|
||||
});
|
||||
|
||||
test('anime series deleted event dispatched', function () {
|
||||
test('anime series deleted event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$series = Series::factory()->createOne();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ use App\Models\Wiki\Anime;
|
||||
use App\Models\Wiki\Studio;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('anime studio created event dispatched', function () {
|
||||
test('anime studio created event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$studio = Studio::factory()->createOne();
|
||||
|
||||
@@ -17,7 +17,7 @@ test('anime studio created event dispatched', function () {
|
||||
Event::assertDispatched(AnimeStudioCreated::class);
|
||||
});
|
||||
|
||||
test('anime studio deleted event dispatched', function () {
|
||||
test('anime studio deleted event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$studio = Studio::factory()->createOne();
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use App\Models\Wiki\Video;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('anime theme entry video created event dispatched', function () {
|
||||
test('anime theme entry video created event dispatched', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
$entry = AnimeThemeEntry::factory()->createOne();
|
||||
|
||||
@@ -19,7 +19,7 @@ test('anime theme entry video created event dispatched', function () {
|
||||
Event::assertDispatched(AnimeThemeEntryVideoCreated::class);
|
||||
});
|
||||
|
||||
test('anime theme entry video deleted event dispatched', function () {
|
||||
test('anime theme entry video deleted event dispatched', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
$entry = AnimeThemeEntry::factory()->createOne();
|
||||
|
||||
@@ -29,7 +29,7 @@ test('anime theme entry video deleted event dispatched', function () {
|
||||
Event::assertDispatched(AnimeThemeEntryVideoDeleted::class);
|
||||
});
|
||||
|
||||
test('anime theme entry video created event update playlist tracks', function () {
|
||||
test('anime theme entry video created event update playlist tracks', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
$entry = AnimeThemeEntry::factory()->createOne();
|
||||
|
||||
@@ -47,7 +47,7 @@ test('anime theme entry video created event update playlist tracks', function ()
|
||||
});
|
||||
});
|
||||
|
||||
test('anime theme entry video deleted event update playlist tracks', function () {
|
||||
test('anime theme entry video deleted event update playlist tracks', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
|
||||
$entry = AnimeThemeEntry::factory()->createOne();
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Pivots\Wiki\ArtistMember;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('artist member created event dispatched', function () {
|
||||
test('artist member created event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$member = Artist::factory()->createOne();
|
||||
|
||||
@@ -19,7 +19,7 @@ test('artist member created event dispatched', function () {
|
||||
Event::assertDispatched(ArtistMemberCreated::class);
|
||||
});
|
||||
|
||||
test('artist member deleted event dispatched', function () {
|
||||
test('artist member deleted event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$member = Artist::factory()->createOne();
|
||||
|
||||
@@ -29,7 +29,7 @@ test('artist member deleted event dispatched', function () {
|
||||
Event::assertDispatched(ArtistMemberDeleted::class);
|
||||
});
|
||||
|
||||
test('artist member updated event dispatched', function () {
|
||||
test('artist member updated event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$member = Artist::factory()->createOne();
|
||||
|
||||
@@ -49,7 +49,7 @@ test('artist member updated event dispatched', function () {
|
||||
Event::assertDispatched(ArtistMemberUpdated::class);
|
||||
});
|
||||
|
||||
test('artist member updated event embed fields', function () {
|
||||
test('artist member updated event embed fields', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$member = Artist::factory()->createOne();
|
||||
|
||||
@@ -66,9 +66,9 @@ test('artist member updated event embed fields', function () {
|
||||
$artistMember->fill($changes->getAttributes());
|
||||
$artistMember->save();
|
||||
|
||||
Event::assertDispatched(ArtistMemberUpdated::class, function (ArtistMemberUpdated $event) {
|
||||
Event::assertDispatched(ArtistMemberUpdated::class, function (ArtistMemberUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('entry created event dispatched', function () {
|
||||
test('entry created event dispatched', function (): void {
|
||||
AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -20,7 +20,7 @@ test('entry created event dispatched', function () {
|
||||
Event::assertDispatched(EntryCreated::class);
|
||||
});
|
||||
|
||||
test('entry deleted event dispatched', function () {
|
||||
test('entry deleted event dispatched', function (): void {
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -30,7 +30,7 @@ test('entry deleted event dispatched', function () {
|
||||
Event::assertDispatched(EntryDeleted::class);
|
||||
});
|
||||
|
||||
test('entry restored event dispatched', function () {
|
||||
test('entry restored event dispatched', function (): void {
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -40,7 +40,7 @@ test('entry restored event dispatched', function () {
|
||||
Event::assertDispatched(EntryRestored::class);
|
||||
});
|
||||
|
||||
test('entry restores quietly', function () {
|
||||
test('entry restores quietly', function (): void {
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -50,7 +50,7 @@ test('entry restores quietly', function () {
|
||||
Event::assertNotDispatched(EntryUpdated::class);
|
||||
});
|
||||
|
||||
test('entry updated event dispatched', function () {
|
||||
test('entry updated event dispatched', function (): void {
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -65,7 +65,7 @@ test('entry updated event dispatched', function () {
|
||||
Event::assertDispatched(EntryUpdated::class);
|
||||
});
|
||||
|
||||
test('entry updated event embed fields', function () {
|
||||
test('entry updated event embed fields', function (): void {
|
||||
$entry = AnimeThemeEntry::factory()
|
||||
->for(AnimeTheme::factory()->for(Anime::factory()))
|
||||
->createOne();
|
||||
@@ -77,9 +77,9 @@ test('entry updated event embed fields', function () {
|
||||
$entry->fill($changes->getAttributes());
|
||||
$entry->save();
|
||||
|
||||
Event::assertDispatched(EntryUpdated::class, function (EntryUpdated $event) {
|
||||
Event::assertDispatched(EntryUpdated::class, function (EntryUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Models\Wiki\Anime\AnimeTheme;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('theme created event dispatched', function () {
|
||||
test('theme created event dispatched', function (): void {
|
||||
AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -19,7 +19,7 @@ test('theme created event dispatched', function () {
|
||||
Event::assertDispatched(ThemeCreated::class);
|
||||
});
|
||||
|
||||
test('theme deleted event dispatched', function () {
|
||||
test('theme deleted event dispatched', function (): void {
|
||||
$theme = AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -29,7 +29,7 @@ test('theme deleted event dispatched', function () {
|
||||
Event::assertDispatched(ThemeDeleted::class);
|
||||
});
|
||||
|
||||
test('theme restored event dispatched', function () {
|
||||
test('theme restored event dispatched', function (): void {
|
||||
$theme = AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -39,7 +39,7 @@ test('theme restored event dispatched', function () {
|
||||
Event::assertDispatched(ThemeRestored::class);
|
||||
});
|
||||
|
||||
test('theme restores quietly', function () {
|
||||
test('theme restores quietly', function (): void {
|
||||
$theme = AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -49,7 +49,7 @@ test('theme restores quietly', function () {
|
||||
Event::assertNotDispatched(ThemeUpdated::class);
|
||||
});
|
||||
|
||||
test('theme updated event dispatched', function () {
|
||||
test('theme updated event dispatched', function (): void {
|
||||
$theme = AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -64,7 +64,7 @@ test('theme updated event dispatched', function () {
|
||||
Event::assertDispatched(ThemeUpdated::class);
|
||||
});
|
||||
|
||||
test('theme updated event embed fields', function () {
|
||||
test('theme updated event embed fields', function (): void {
|
||||
$theme = AnimeTheme::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -76,9 +76,9 @@ test('theme updated event embed fields', function () {
|
||||
$theme->fill($changes->getAttributes());
|
||||
$theme->save();
|
||||
|
||||
Event::assertDispatched(ThemeUpdated::class, function (ThemeUpdated $event) {
|
||||
Event::assertDispatched(ThemeUpdated::class, function (ThemeUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Anime;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('anime created event dispatched', function () {
|
||||
test('anime created event dispatched', function (): void {
|
||||
Anime::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(AnimeCreated::class);
|
||||
});
|
||||
|
||||
test('anime deleted event dispatched', function () {
|
||||
test('anime deleted event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
|
||||
$anime->delete();
|
||||
@@ -24,7 +24,7 @@ test('anime deleted event dispatched', function () {
|
||||
Event::assertDispatched(AnimeDeleted::class);
|
||||
});
|
||||
|
||||
test('anime restored event dispatched', function () {
|
||||
test('anime restored event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
|
||||
$anime->restore();
|
||||
@@ -32,7 +32,7 @@ test('anime restored event dispatched', function () {
|
||||
Event::assertDispatched(AnimeRestored::class);
|
||||
});
|
||||
|
||||
test('anime restores quietly', function () {
|
||||
test('anime restores quietly', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
|
||||
$anime->restore();
|
||||
@@ -40,7 +40,7 @@ test('anime restores quietly', function () {
|
||||
Event::assertNotDispatched(AnimeUpdated::class);
|
||||
});
|
||||
|
||||
test('anime updated event dispatched', function () {
|
||||
test('anime updated event dispatched', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$changes = Anime::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('anime updated event dispatched', function () {
|
||||
Event::assertDispatched(AnimeUpdated::class);
|
||||
});
|
||||
|
||||
test('anime updated event embed fields', function () {
|
||||
test('anime updated event embed fields', function (): void {
|
||||
$anime = Anime::factory()->createOne();
|
||||
$changes = Anime::factory()->makeOne();
|
||||
|
||||
$anime->fill($changes->getAttributes());
|
||||
$anime->save();
|
||||
|
||||
Event::assertDispatched(AnimeUpdated::class, function (AnimeUpdated $event) {
|
||||
Event::assertDispatched(AnimeUpdated::class, function (AnimeUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Artist;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('artist created event dispatched', function () {
|
||||
test('artist created event dispatched', function (): void {
|
||||
Artist::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(ArtistCreated::class);
|
||||
});
|
||||
|
||||
test('artist deleted event dispatched', function () {
|
||||
test('artist deleted event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
|
||||
$artist->delete();
|
||||
@@ -24,7 +24,7 @@ test('artist deleted event dispatched', function () {
|
||||
Event::assertDispatched(ArtistDeleted::class);
|
||||
});
|
||||
|
||||
test('artist restored event dispatched', function () {
|
||||
test('artist restored event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
|
||||
$artist->restore();
|
||||
@@ -32,7 +32,7 @@ test('artist restored event dispatched', function () {
|
||||
Event::assertDispatched(ArtistRestored::class);
|
||||
});
|
||||
|
||||
test('artist restores quietly', function () {
|
||||
test('artist restores quietly', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
|
||||
$artist->restore();
|
||||
@@ -40,7 +40,7 @@ test('artist restores quietly', function () {
|
||||
Event::assertNotDispatched(ArtistUpdated::class);
|
||||
});
|
||||
|
||||
test('artist updated event dispatched', function () {
|
||||
test('artist updated event dispatched', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$changes = Artist::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('artist updated event dispatched', function () {
|
||||
Event::assertDispatched(ArtistUpdated::class);
|
||||
});
|
||||
|
||||
test('artist updated event embed fields', function () {
|
||||
test('artist updated event embed fields', function (): void {
|
||||
$artist = Artist::factory()->createOne();
|
||||
$changes = Artist::factory()->makeOne();
|
||||
|
||||
$artist->fill($changes->getAttributes());
|
||||
$artist->save();
|
||||
|
||||
Event::assertDispatched(ArtistUpdated::class, function (ArtistUpdated $event) {
|
||||
Event::assertDispatched(ArtistUpdated::class, function (ArtistUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Audio;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('audio created event dispatched', function () {
|
||||
test('audio created event dispatched', function (): void {
|
||||
Audio::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(AudioCreated::class);
|
||||
});
|
||||
|
||||
test('audio deleted event dispatched', function () {
|
||||
test('audio deleted event dispatched', function (): void {
|
||||
$audio = Audio::factory()->createOne();
|
||||
|
||||
$audio->delete();
|
||||
@@ -24,7 +24,7 @@ test('audio deleted event dispatched', function () {
|
||||
Event::assertDispatched(AudioDeleted::class);
|
||||
});
|
||||
|
||||
test('audio restored event dispatched', function () {
|
||||
test('audio restored event dispatched', function (): void {
|
||||
$audio = Audio::factory()->createOne();
|
||||
|
||||
$audio->restore();
|
||||
@@ -32,7 +32,7 @@ test('audio restored event dispatched', function () {
|
||||
Event::assertDispatched(AudioRestored::class);
|
||||
});
|
||||
|
||||
test('audio restores quietly', function () {
|
||||
test('audio restores quietly', function (): void {
|
||||
$audio = Audio::factory()->createOne();
|
||||
|
||||
$audio->restore();
|
||||
@@ -40,7 +40,7 @@ test('audio restores quietly', function () {
|
||||
Event::assertNotDispatched(AudioUpdated::class);
|
||||
});
|
||||
|
||||
test('audio updated event dispatched', function () {
|
||||
test('audio updated event dispatched', function (): void {
|
||||
$audio = Audio::factory()->createOne();
|
||||
$changes = Audio::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('audio updated event dispatched', function () {
|
||||
Event::assertDispatched(AudioUpdated::class);
|
||||
});
|
||||
|
||||
test('audio updated event embed fields', function () {
|
||||
test('audio updated event embed fields', function (): void {
|
||||
$audio = Audio::factory()->createOne();
|
||||
$changes = Audio::factory()->makeOne();
|
||||
|
||||
$audio->fill($changes->getAttributes());
|
||||
$audio->save();
|
||||
|
||||
Event::assertDispatched(AudioUpdated::class, function (AudioUpdated $event) {
|
||||
Event::assertDispatched(AudioUpdated::class, function (AudioUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\ExternalResource;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('external resource created event dispatched', function () {
|
||||
test('external resource created event dispatched', function (): void {
|
||||
ExternalResource::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(ExternalResourceCreated::class);
|
||||
});
|
||||
|
||||
test('external resource deleted event dispatched', function () {
|
||||
test('external resource deleted event dispatched', function (): void {
|
||||
$resource = ExternalResource::factory()->createOne();
|
||||
|
||||
$resource->delete();
|
||||
@@ -24,7 +24,7 @@ test('external resource deleted event dispatched', function () {
|
||||
Event::assertDispatched(ExternalResourceDeleted::class);
|
||||
});
|
||||
|
||||
test('external resource restored event dispatched', function () {
|
||||
test('external resource restored event dispatched', function (): void {
|
||||
$resource = ExternalResource::factory()->createOne();
|
||||
|
||||
$resource->restore();
|
||||
@@ -32,7 +32,7 @@ test('external resource restored event dispatched', function () {
|
||||
Event::assertDispatched(ExternalResourceRestored::class);
|
||||
});
|
||||
|
||||
test('external resource restores quietly', function () {
|
||||
test('external resource restores quietly', function (): void {
|
||||
$resource = ExternalResource::factory()->createOne();
|
||||
|
||||
$resource->restore();
|
||||
@@ -40,7 +40,7 @@ test('external resource restores quietly', function () {
|
||||
Event::assertNotDispatched(ExternalResourceUpdated::class);
|
||||
});
|
||||
|
||||
test('external resource updated event dispatched', function () {
|
||||
test('external resource updated event dispatched', function (): void {
|
||||
$resource = ExternalResource::factory()->createOne();
|
||||
$changes = ExternalResource::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('external resource updated event dispatched', function () {
|
||||
Event::assertDispatched(ExternalResourceUpdated::class);
|
||||
});
|
||||
|
||||
test('external resource updated event embed fields', function () {
|
||||
test('external resource updated event embed fields', function (): void {
|
||||
$resource = ExternalResource::factory()->createOne();
|
||||
$changes = ExternalResource::factory()->makeOne();
|
||||
|
||||
$resource->fill($changes->getAttributes());
|
||||
$resource->save();
|
||||
|
||||
Event::assertDispatched(ExternalResourceUpdated::class, function (ExternalResourceUpdated $event) {
|
||||
Event::assertDispatched(ExternalResourceUpdated::class, function (ExternalResourceUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Group;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('group created event dispatched', function () {
|
||||
test('group created event dispatched', function (): void {
|
||||
Group::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(GroupCreated::class);
|
||||
});
|
||||
|
||||
test('group deleted event dispatched', function () {
|
||||
test('group deleted event dispatched', function (): void {
|
||||
$group = Group::factory()->createOne();
|
||||
|
||||
$group->delete();
|
||||
@@ -24,7 +24,7 @@ test('group deleted event dispatched', function () {
|
||||
Event::assertDispatched(GroupDeleted::class);
|
||||
});
|
||||
|
||||
test('group restored event dispatched', function () {
|
||||
test('group restored event dispatched', function (): void {
|
||||
$group = Group::factory()->createOne();
|
||||
|
||||
$group->restore();
|
||||
@@ -32,7 +32,7 @@ test('group restored event dispatched', function () {
|
||||
Event::assertDispatched(GroupRestored::class);
|
||||
});
|
||||
|
||||
test('group restores quietly', function () {
|
||||
test('group restores quietly', function (): void {
|
||||
$group = Group::factory()->createOne();
|
||||
|
||||
$group->restore();
|
||||
@@ -40,7 +40,7 @@ test('group restores quietly', function () {
|
||||
Event::assertNotDispatched(GroupUpdated::class);
|
||||
});
|
||||
|
||||
test('group updated event dispatched', function () {
|
||||
test('group updated event dispatched', function (): void {
|
||||
$group = Group::factory()->createOne();
|
||||
$changes = Group::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('group updated event dispatched', function () {
|
||||
Event::assertDispatched(GroupUpdated::class);
|
||||
});
|
||||
|
||||
test('group updated event embed fields', function () {
|
||||
test('group updated event embed fields', function (): void {
|
||||
$group = Group::factory()->createOne();
|
||||
$changes = Group::factory()->makeOne();
|
||||
|
||||
$group->fill($changes->getAttributes());
|
||||
$group->save();
|
||||
|
||||
Event::assertDispatched(GroupUpdated::class, function (GroupUpdated $event) {
|
||||
Event::assertDispatched(GroupUpdated::class, function (GroupUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Image;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('image created event dispatched', function () {
|
||||
test('image created event dispatched', function (): void {
|
||||
Image::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(ImageCreated::class);
|
||||
});
|
||||
|
||||
test('image deleted event dispatched', function () {
|
||||
test('image deleted event dispatched', function (): void {
|
||||
$image = Image::factory()->createOne();
|
||||
|
||||
$image->delete();
|
||||
@@ -24,7 +24,7 @@ test('image deleted event dispatched', function () {
|
||||
Event::assertDispatched(ImageDeleted::class);
|
||||
});
|
||||
|
||||
test('image restored event dispatched', function () {
|
||||
test('image restored event dispatched', function (): void {
|
||||
$image = Image::factory()->createOne();
|
||||
|
||||
$image->restore();
|
||||
@@ -32,7 +32,7 @@ test('image restored event dispatched', function () {
|
||||
Event::assertDispatched(ImageRestored::class);
|
||||
});
|
||||
|
||||
test('image restores quietly', function () {
|
||||
test('image restores quietly', function (): void {
|
||||
$image = Image::factory()->createOne();
|
||||
|
||||
$image->restore();
|
||||
@@ -40,7 +40,7 @@ test('image restores quietly', function () {
|
||||
Event::assertNotDispatched(ImageUpdated::class);
|
||||
});
|
||||
|
||||
test('image updated event dispatched', function () {
|
||||
test('image updated event dispatched', function (): void {
|
||||
$image = Image::factory()->createOne();
|
||||
$changes = Image::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('image updated event dispatched', function () {
|
||||
Event::assertDispatched(ImageUpdated::class);
|
||||
});
|
||||
|
||||
test('image updated event embed fields', function () {
|
||||
test('image updated event embed fields', function (): void {
|
||||
$image = Image::factory()->createOne();
|
||||
$changes = Image::factory()->makeOne();
|
||||
|
||||
$image->fill($changes->getAttributes());
|
||||
$image->save();
|
||||
|
||||
Event::assertDispatched(ImageUpdated::class, function (ImageUpdated $event) {
|
||||
Event::assertDispatched(ImageUpdated::class, function (ImageUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Series;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('series created event dispatched', function () {
|
||||
test('series created event dispatched', function (): void {
|
||||
Series::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(SeriesCreated::class);
|
||||
});
|
||||
|
||||
test('series deleted event dispatched', function () {
|
||||
test('series deleted event dispatched', function (): void {
|
||||
$series = Series::factory()->createOne();
|
||||
|
||||
$series->delete();
|
||||
@@ -24,7 +24,7 @@ test('series deleted event dispatched', function () {
|
||||
Event::assertDispatched(SeriesDeleted::class);
|
||||
});
|
||||
|
||||
test('series restored event dispatched', function () {
|
||||
test('series restored event dispatched', function (): void {
|
||||
$series = Series::factory()->createOne();
|
||||
|
||||
$series->restore();
|
||||
@@ -32,7 +32,7 @@ test('series restored event dispatched', function () {
|
||||
Event::assertDispatched(SeriesRestored::class);
|
||||
});
|
||||
|
||||
test('series restores quietly', function () {
|
||||
test('series restores quietly', function (): void {
|
||||
$series = Series::factory()->createOne();
|
||||
|
||||
$series->restore();
|
||||
@@ -40,7 +40,7 @@ test('series restores quietly', function () {
|
||||
Event::assertNotDispatched(SeriesUpdated::class);
|
||||
});
|
||||
|
||||
test('series updated event dispatched', function () {
|
||||
test('series updated event dispatched', function (): void {
|
||||
$series = Series::factory()->createOne();
|
||||
$changes = Series::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('series updated event dispatched', function () {
|
||||
Event::assertDispatched(SeriesUpdated::class);
|
||||
});
|
||||
|
||||
test('series updated event embed fields', function () {
|
||||
test('series updated event embed fields', function (): void {
|
||||
$series = Series::factory()->createOne();
|
||||
$changes = Series::factory()->makeOne();
|
||||
|
||||
$series->fill($changes->getAttributes());
|
||||
$series->save();
|
||||
|
||||
Event::assertDispatched(SeriesUpdated::class, function (SeriesUpdated $event) {
|
||||
Event::assertDispatched(SeriesUpdated::class, function (SeriesUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Song\Performance;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('performance created event dispatched', function () {
|
||||
test('performance created event dispatched', function (): void {
|
||||
Performance::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(PerformanceCreated::class);
|
||||
});
|
||||
|
||||
test('performance deleted event dispatched', function () {
|
||||
test('performance deleted event dispatched', function (): void {
|
||||
$performance = Performance::factory()->createOne();
|
||||
|
||||
$performance->delete();
|
||||
@@ -24,7 +24,7 @@ test('performance deleted event dispatched', function () {
|
||||
Event::assertDispatched(PerformanceDeleted::class);
|
||||
});
|
||||
|
||||
test('performance restored event dispatched', function () {
|
||||
test('performance restored event dispatched', function (): void {
|
||||
$performance = Performance::factory()->createOne();
|
||||
|
||||
$performance->restore();
|
||||
@@ -32,7 +32,7 @@ test('performance restored event dispatched', function () {
|
||||
Event::assertDispatched(PerformanceRestored::class);
|
||||
});
|
||||
|
||||
test('performance restores quietly', function () {
|
||||
test('performance restores quietly', function (): void {
|
||||
$performance = Performance::factory()->createOne();
|
||||
|
||||
$performance->restore();
|
||||
@@ -40,7 +40,7 @@ test('performance restores quietly', function () {
|
||||
Event::assertNotDispatched(PerformanceUpdated::class);
|
||||
});
|
||||
|
||||
test('performance updated event dispatched', function () {
|
||||
test('performance updated event dispatched', function (): void {
|
||||
$performance = Performance::factory()->createOne();
|
||||
$changes = Performance::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('performance updated event dispatched', function () {
|
||||
Event::assertDispatched(PerformanceUpdated::class);
|
||||
});
|
||||
|
||||
test('performance updated event embed fields', function () {
|
||||
test('performance updated event embed fields', function (): void {
|
||||
$performance = Performance::factory()->createOne();
|
||||
$changes = Performance::factory()->makeOne();
|
||||
|
||||
$performance->fill($changes->getAttributes());
|
||||
$performance->save();
|
||||
|
||||
Event::assertDispatched(PerformanceUpdated::class, function (PerformanceUpdated $event) {
|
||||
Event::assertDispatched(PerformanceUpdated::class, function (PerformanceUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Song;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('song created event dispatched', function () {
|
||||
test('song created event dispatched', function (): void {
|
||||
Song::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(SongCreated::class);
|
||||
});
|
||||
|
||||
test('song deleted event dispatched', function () {
|
||||
test('song deleted event dispatched', function (): void {
|
||||
$song = Song::factory()->createOne();
|
||||
|
||||
$song->delete();
|
||||
@@ -24,7 +24,7 @@ test('song deleted event dispatched', function () {
|
||||
Event::assertDispatched(SongDeleted::class);
|
||||
});
|
||||
|
||||
test('song restored event dispatched', function () {
|
||||
test('song restored event dispatched', function (): void {
|
||||
$song = Song::factory()->createOne();
|
||||
|
||||
$song->restore();
|
||||
@@ -32,7 +32,7 @@ test('song restored event dispatched', function () {
|
||||
Event::assertDispatched(SongRestored::class);
|
||||
});
|
||||
|
||||
test('song restores quietly', function () {
|
||||
test('song restores quietly', function (): void {
|
||||
$song = Song::factory()->createOne();
|
||||
|
||||
$song->restore();
|
||||
@@ -40,7 +40,7 @@ test('song restores quietly', function () {
|
||||
Event::assertNotDispatched(SongUpdated::class);
|
||||
});
|
||||
|
||||
test('song updated event dispatched', function () {
|
||||
test('song updated event dispatched', function (): void {
|
||||
$song = Song::factory()->createOne();
|
||||
$changes = Song::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('song updated event dispatched', function () {
|
||||
Event::assertDispatched(SongUpdated::class);
|
||||
});
|
||||
|
||||
test('song updated event embed fields', function () {
|
||||
test('song updated event embed fields', function (): void {
|
||||
$song = Song::factory()->createOne();
|
||||
$changes = Song::factory()->makeOne();
|
||||
|
||||
$song->fill($changes->getAttributes());
|
||||
$song->save();
|
||||
|
||||
Event::assertDispatched(SongUpdated::class, function (SongUpdated $event) {
|
||||
Event::assertDispatched(SongUpdated::class, function (SongUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Studio;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('studio created event dispatched', function () {
|
||||
test('studio created event dispatched', function (): void {
|
||||
Studio::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(StudioCreated::class);
|
||||
});
|
||||
|
||||
test('studio deleted event dispatched', function () {
|
||||
test('studio deleted event dispatched', function (): void {
|
||||
$studio = Studio::factory()->createOne();
|
||||
|
||||
$studio->delete();
|
||||
@@ -24,7 +24,7 @@ test('studio deleted event dispatched', function () {
|
||||
Event::assertDispatched(StudioDeleted::class);
|
||||
});
|
||||
|
||||
test('studio restored event dispatched', function () {
|
||||
test('studio restored event dispatched', function (): void {
|
||||
$studio = Studio::factory()->createOne();
|
||||
|
||||
$studio->restore();
|
||||
@@ -32,7 +32,7 @@ test('studio restored event dispatched', function () {
|
||||
Event::assertDispatched(StudioRestored::class);
|
||||
});
|
||||
|
||||
test('studio restores quietly', function () {
|
||||
test('studio restores quietly', function (): void {
|
||||
$studio = Studio::factory()->createOne();
|
||||
|
||||
$studio->restore();
|
||||
@@ -40,7 +40,7 @@ test('studio restores quietly', function () {
|
||||
Event::assertNotDispatched(StudioUpdated::class);
|
||||
});
|
||||
|
||||
test('studio updated event dispatched', function () {
|
||||
test('studio updated event dispatched', function (): void {
|
||||
$studio = Studio::factory()->createOne();
|
||||
$changes = Studio::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('studio updated event dispatched', function () {
|
||||
Event::assertDispatched(StudioUpdated::class);
|
||||
});
|
||||
|
||||
test('studio updated event embed fields', function () {
|
||||
test('studio updated event embed fields', function (): void {
|
||||
$studio = Studio::factory()->createOne();
|
||||
$changes = Studio::factory()->makeOne();
|
||||
|
||||
$studio->fill($changes->getAttributes());
|
||||
$studio->save();
|
||||
|
||||
Event::assertDispatched(StudioUpdated::class, function (StudioUpdated $event) {
|
||||
Event::assertDispatched(StudioUpdated::class, function (StudioUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Models\Wiki\Synonym;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('synonym created event dispatched', function () {
|
||||
test('synonym created event dispatched', function (): void {
|
||||
Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -19,7 +19,7 @@ test('synonym created event dispatched', function () {
|
||||
Event::assertDispatched(SynonymCreated::class);
|
||||
});
|
||||
|
||||
test('synonym deleted event dispatched', function () {
|
||||
test('synonym deleted event dispatched', function (): void {
|
||||
$synonym = Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -29,7 +29,7 @@ test('synonym deleted event dispatched', function () {
|
||||
Event::assertDispatched(SynonymDeleted::class);
|
||||
});
|
||||
|
||||
test('synonym restored event dispatched', function () {
|
||||
test('synonym restored event dispatched', function (): void {
|
||||
$synonym = Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -39,7 +39,7 @@ test('synonym restored event dispatched', function () {
|
||||
Event::assertDispatched(SynonymRestored::class);
|
||||
});
|
||||
|
||||
test('synonym restores quietly', function () {
|
||||
test('synonym restores quietly', function (): void {
|
||||
$synonym = Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -49,7 +49,7 @@ test('synonym restores quietly', function () {
|
||||
Event::assertNotDispatched(SynonymUpdated::class);
|
||||
});
|
||||
|
||||
test('synonym updated event dispatched', function () {
|
||||
test('synonym updated event dispatched', function (): void {
|
||||
$synonym = Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -64,7 +64,7 @@ test('synonym updated event dispatched', function () {
|
||||
Event::assertDispatched(SynonymUpdated::class);
|
||||
});
|
||||
|
||||
test('synonym updated event embed fields', function () {
|
||||
test('synonym updated event embed fields', function (): void {
|
||||
$synonym = Synonym::factory()
|
||||
->for(Anime::factory(), Synonym::RELATION_SYNONYMABLE)
|
||||
->createOne();
|
||||
@@ -76,9 +76,9 @@ test('synonym updated event embed fields', function () {
|
||||
$synonym->fill($changes->getAttributes());
|
||||
$synonym->save();
|
||||
|
||||
Event::assertDispatched(SynonymUpdated::class, function (SynonymUpdated $event) {
|
||||
Event::assertDispatched(SynonymUpdated::class, function (SynonymUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Video\VideoScript;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('video script created event dispatched', function () {
|
||||
test('video script created event dispatched', function (): void {
|
||||
VideoScript::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(VideoScriptCreated::class);
|
||||
});
|
||||
|
||||
test('video script deleted event dispatched', function () {
|
||||
test('video script deleted event dispatched', function (): void {
|
||||
$script = VideoScript::factory()->createOne();
|
||||
|
||||
$script->delete();
|
||||
@@ -24,7 +24,7 @@ test('video script deleted event dispatched', function () {
|
||||
Event::assertDispatched(VideoScriptDeleted::class);
|
||||
});
|
||||
|
||||
test('video script restored event dispatched', function () {
|
||||
test('video script restored event dispatched', function (): void {
|
||||
$script = VideoScript::factory()->createOne();
|
||||
|
||||
$script->restore();
|
||||
@@ -32,7 +32,7 @@ test('video script restored event dispatched', function () {
|
||||
Event::assertDispatched(VideoScriptRestored::class);
|
||||
});
|
||||
|
||||
test('video script restores quietly', function () {
|
||||
test('video script restores quietly', function (): void {
|
||||
$script = VideoScript::factory()->createOne();
|
||||
|
||||
$script->restore();
|
||||
@@ -40,7 +40,7 @@ test('video script restores quietly', function () {
|
||||
Event::assertNotDispatched(VideoScriptUpdated::class);
|
||||
});
|
||||
|
||||
test('video script updated event dispatched', function () {
|
||||
test('video script updated event dispatched', function (): void {
|
||||
$script = VideoScript::factory()->createOne();
|
||||
$changes = VideoScript::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('video script updated event dispatched', function () {
|
||||
Event::assertDispatched(VideoScriptUpdated::class);
|
||||
});
|
||||
|
||||
test('video script updated event embed fields', function () {
|
||||
test('video script updated event embed fields', function (): void {
|
||||
$script = VideoScript::factory()->createOne();
|
||||
$changes = VideoScript::factory()->makeOne();
|
||||
|
||||
$script->fill($changes->getAttributes());
|
||||
$script->save();
|
||||
|
||||
Event::assertDispatched(VideoScriptUpdated::class, function (VideoScriptUpdated $event) {
|
||||
Event::assertDispatched(VideoScriptUpdated::class, function (VideoScriptUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,13 +10,13 @@ use App\Models\Wiki\Video;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
test('video created event dispatched', function () {
|
||||
test('video created event dispatched', function (): void {
|
||||
Video::factory()->createOne();
|
||||
|
||||
Event::assertDispatched(VideoCreated::class);
|
||||
});
|
||||
|
||||
test('video deleted event dispatched', function () {
|
||||
test('video deleted event dispatched', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
|
||||
$video->delete();
|
||||
@@ -24,7 +24,7 @@ test('video deleted event dispatched', function () {
|
||||
Event::assertDispatched(VideoDeleted::class);
|
||||
});
|
||||
|
||||
test('video restored event dispatched', function () {
|
||||
test('video restored event dispatched', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
|
||||
$video->restore();
|
||||
@@ -32,7 +32,7 @@ test('video restored event dispatched', function () {
|
||||
Event::assertDispatched(VideoRestored::class);
|
||||
});
|
||||
|
||||
test('video restores quietly', function () {
|
||||
test('video restores quietly', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
|
||||
$video->restore();
|
||||
@@ -40,7 +40,7 @@ test('video restores quietly', function () {
|
||||
Event::assertNotDispatched(VideoUpdated::class);
|
||||
});
|
||||
|
||||
test('video updated event dispatched', function () {
|
||||
test('video updated event dispatched', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
$changes = Video::factory()->makeOne();
|
||||
|
||||
@@ -50,16 +50,16 @@ test('video updated event dispatched', function () {
|
||||
Event::assertDispatched(VideoUpdated::class);
|
||||
});
|
||||
|
||||
test('video updated event embed fields', function () {
|
||||
test('video updated event embed fields', function (): void {
|
||||
$video = Video::factory()->createOne();
|
||||
$changes = Video::factory()->makeOne();
|
||||
|
||||
$video->fill($changes->getAttributes());
|
||||
$video->save();
|
||||
|
||||
Event::assertDispatched(VideoUpdated::class, function (VideoUpdated $event) {
|
||||
Event::assertDispatched(VideoUpdated::class, function (VideoUpdated $event): bool {
|
||||
$message = $event->getDiscordMessage();
|
||||
|
||||
return ! empty(Arr::get($message->embed, 'fields'));
|
||||
return filled(Arr::get($message->embed, 'fields'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -35,19 +35,19 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(AnnouncementResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = AnnouncementModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(AnnouncementResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = AnnouncementModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(AnnouncementResource::class))
|
||||
|
||||
@@ -15,7 +15,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -34,14 +34,14 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = DumpModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(DumpResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = DumpModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(DumpResource::class))
|
||||
|
||||
@@ -15,7 +15,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -34,14 +34,14 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = FeatureModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(FeatureResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = FeatureModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(FeatureResource::class))
|
||||
|
||||
@@ -18,7 +18,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -37,7 +37,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -53,7 +53,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -68,7 +68,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -89,19 +89,19 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(FeaturedThemeResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = FeaturedThemeModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(FeaturedThemeResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = FeaturedThemeModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(FeaturedThemeResource::class))
|
||||
|
||||
@@ -17,7 +17,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -39,7 +39,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -57,7 +57,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -72,7 +72,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -92,12 +92,12 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(DiscordThreadResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = DiscordThreadModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -106,7 +106,7 @@ test('user cannot edit record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = DiscordThreadModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
|
||||
@@ -18,7 +18,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -37,7 +37,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -53,7 +53,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -68,7 +68,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -86,26 +86,26 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(PageResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = PageModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(PageResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = PageModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(PageResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(DeleteAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot restore record', function () {
|
||||
test('user cannot restore record', function (): void {
|
||||
$record = PageModel::factory()->createOne();
|
||||
|
||||
$record->delete();
|
||||
@@ -115,7 +115,7 @@ test('user cannot restore record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(RestoreAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot force delete record', function () {
|
||||
test('user cannot force delete record', function (): void {
|
||||
$record = PageModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(PageResource::class))
|
||||
|
||||
@@ -19,11 +19,11 @@ use function Pest\Laravel\get;
|
||||
/**
|
||||
* Initial setup for the tests.
|
||||
*/
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
Filament::setServingStatus();
|
||||
});
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -45,7 +45,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -64,7 +64,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
|
||||
@@ -19,11 +19,11 @@ use function Pest\Laravel\get;
|
||||
/**
|
||||
* Initial setup for the tests.
|
||||
*/
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
Filament::setServingStatus();
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -40,7 +40,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -60,7 +60,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -76,7 +76,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
|
||||
@@ -20,11 +20,11 @@ use function Pest\Laravel\get;
|
||||
/**
|
||||
* Initial setup for the tests.
|
||||
*/
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
Filament::setServingStatus();
|
||||
});
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -46,7 +46,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -65,7 +65,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -81,7 +81,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
|
||||
@@ -19,11 +19,11 @@ use function Pest\Laravel\get;
|
||||
/**
|
||||
* Initial setup for the tests.
|
||||
*/
|
||||
beforeEach(function () {
|
||||
beforeEach(function (): void {
|
||||
Filament::setServingStatus();
|
||||
});
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -43,7 +43,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -60,7 +60,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
@@ -76,7 +76,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withAdmin()
|
||||
->withPermissions(
|
||||
|
||||
@@ -18,7 +18,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -39,7 +39,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -57,7 +57,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -72,7 +72,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -92,12 +92,12 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(EntryResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = AnimeThemeEntryModel::factory()
|
||||
->forAnime()
|
||||
->createOne();
|
||||
@@ -106,7 +106,7 @@ test('user cannot edit record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = AnimeThemeEntryModel::factory()
|
||||
->forAnime()
|
||||
->createOne();
|
||||
@@ -115,7 +115,7 @@ test('user cannot delete record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(DeleteAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot restore record', function () {
|
||||
test('user cannot restore record', function (): void {
|
||||
$record = AnimeThemeEntryModel::factory()
|
||||
->forAnime()
|
||||
->createOne();
|
||||
@@ -127,7 +127,7 @@ test('user cannot restore record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(RestoreAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot force delete record', function () {
|
||||
test('user cannot force delete record', function (): void {
|
||||
$record = AnimeThemeEntryModel::factory()
|
||||
->forAnime()
|
||||
->createOne();
|
||||
|
||||
@@ -19,7 +19,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -40,7 +40,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -58,7 +58,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -73,7 +73,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -93,12 +93,12 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(ThemeResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = AnimeThemeModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -107,7 +107,7 @@ test('user cannot edit record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = AnimeThemeModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -116,7 +116,7 @@ test('user cannot delete record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(DeleteAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot restore record', function () {
|
||||
test('user cannot restore record', function (): void {
|
||||
$record = AnimeThemeModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
@@ -128,7 +128,7 @@ test('user cannot restore record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(RestoreAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot force delete record', function () {
|
||||
test('user cannot force delete record', function (): void {
|
||||
$record = AnimeThemeModel::factory()
|
||||
->for(Anime::factory())
|
||||
->createOne();
|
||||
|
||||
@@ -18,7 +18,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -37,7 +37,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -53,7 +53,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -68,7 +68,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -86,26 +86,26 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(AnimeResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = AnimeModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(AnimeResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = AnimeModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(AnimeResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(DeleteAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot restore record', function () {
|
||||
test('user cannot restore record', function (): void {
|
||||
$record = AnimeModel::factory()->createOne();
|
||||
|
||||
$record->delete();
|
||||
@@ -115,7 +115,7 @@ test('user cannot restore record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(RestoreAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot force delete record', function () {
|
||||
test('user cannot force delete record', function (): void {
|
||||
$record = AnimeModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(AnimeResource::class))
|
||||
|
||||
@@ -18,7 +18,7 @@ use Livewire\Livewire;
|
||||
use function Pest\Laravel\actingAs;
|
||||
use function Pest\Laravel\get;
|
||||
|
||||
test('render index page', function () {
|
||||
test('render index page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -37,7 +37,7 @@ test('render index page', function () {
|
||||
->assertCanSeeTableRecords($records);
|
||||
});
|
||||
|
||||
test('render view page', function () {
|
||||
test('render view page', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -53,7 +53,7 @@ test('render view page', function () {
|
||||
->assertSuccessful();
|
||||
});
|
||||
|
||||
test('mount create action', function () {
|
||||
test('mount create action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -68,7 +68,7 @@ test('mount create action', function () {
|
||||
->assertActionMounted(CreateAction::class);
|
||||
});
|
||||
|
||||
test('mount edit action', function () {
|
||||
test('mount edit action', function (): void {
|
||||
$user = User::factory()
|
||||
->withPermissions(
|
||||
SpecialPermission::VIEW_FILAMENT->value,
|
||||
@@ -86,26 +86,26 @@ test('mount edit action', function () {
|
||||
->assertHasNoErrors();
|
||||
});
|
||||
|
||||
test('user cannot create record', function () {
|
||||
test('user cannot create record', function (): void {
|
||||
Livewire::test(getIndexPage(ArtistResource::class))
|
||||
->assertActionHidden(CreateAction::class);
|
||||
});
|
||||
|
||||
test('user cannot edit record', function () {
|
||||
test('user cannot edit record', function (): void {
|
||||
$record = ArtistModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(ArtistResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(EditAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot delete record', function () {
|
||||
test('user cannot delete record', function (): void {
|
||||
$record = ArtistModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(ArtistResource::class))
|
||||
->assertActionDoesNotExist(TestAction::make(DeleteAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot restore record', function () {
|
||||
test('user cannot restore record', function (): void {
|
||||
$record = ArtistModel::factory()->createOne();
|
||||
|
||||
$record->delete();
|
||||
@@ -115,7 +115,7 @@ test('user cannot restore record', function () {
|
||||
->assertActionDoesNotExist(TestAction::make(RestoreAction::getDefaultName())->table($record));
|
||||
});
|
||||
|
||||
test('user cannot force delete record', function () {
|
||||
test('user cannot force delete record', function (): void {
|
||||
$record = ArtistModel::factory()->createOne();
|
||||
|
||||
Livewire::test(getIndexPage(ArtistResource::class))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user