mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
29 lines
817 B
PHP
29 lines
817 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Events\Pivot\List\PlaylistImage\PlaylistImageCreated;
|
|
use App\Events\Pivot\List\PlaylistImage\PlaylistImageDeleted;
|
|
use App\Models\List\Playlist;
|
|
use App\Models\Wiki\Image;
|
|
use Illuminate\Support\Facades\Event;
|
|
|
|
test('playlist image created event dispatched', function () {
|
|
$playlist = Playlist::factory()->createOne();
|
|
$image = Image::factory()->createOne();
|
|
|
|
$playlist->images()->attach($image);
|
|
|
|
Event::assertDispatched(PlaylistImageCreated::class);
|
|
});
|
|
|
|
test('playlist image deleted event dispatched', function () {
|
|
$playlist = Playlist::factory()->createOne();
|
|
$image = Image::factory()->createOne();
|
|
|
|
$playlist->images()->attach($image);
|
|
$playlist->images()->detach($image);
|
|
|
|
Event::assertDispatched(PlaylistImageDeleted::class);
|
|
});
|