Files
animethemes-server/tests/Unit/Pivots/Wiki/AnimeThemeEntryVideoTest.php
T
paranarimasu 517ba0ebf8 Playlists (#472)
* feat: add playlist resources

* style: fix StyleCI findings

* fix(admin): address nova exceptions
2022-10-19 00:32:06 -05:00

52 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Pivots\Wiki;
use App\Models\Wiki\Anime;
use App\Models\Wiki\Anime\AnimeTheme;
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
use App\Models\Wiki\Video;
use App\Pivots\Wiki\AnimeThemeEntryVideo;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Tests\TestCase;
/**
* Class AnimeThemeEntryVideoTest.
*/
class AnimeThemeEntryVideoTest extends TestCase
{
/**
* An AnimeThemeEntryVideo shall belong to a Video.
*
* @return void
*/
public function testVideo(): void
{
$animeThemeEntryVideo = AnimeThemeEntryVideo::factory()
->for(Video::factory())
->for(AnimeThemeEntry::factory()->for(AnimeTheme::factory()->for(Anime::factory())))
->createOne();
static::assertInstanceOf(BelongsTo::class, $animeThemeEntryVideo->video());
static::assertInstanceOf(Video::class, $animeThemeEntryVideo->video()->first());
}
/**
* An AnimeThemeEntryVideo shall belong to an Entry.
*
* @return void
*/
public function testEntry(): void
{
$animeThemeEntryVideo = AnimeThemeEntryVideo::factory()
->for(Video::factory())
->for(AnimeThemeEntry::factory()->for(AnimeTheme::factory()->for(Anime::factory())))
->createOne();
static::assertInstanceOf(BelongsTo::class, $animeThemeEntryVideo->animethemeentry());
static::assertInstanceOf(AnimeThemeEntry::class, $animeThemeEntryVideo->animethemeentry()->first());
}
}