Files
animethemes-server/tests/Unit/Pivots/Wiki/ArtistSongTest.php
T
2025-07-29 23:31:12 -03:00

29 lines
781 B
PHP

<?php
declare(strict_types=1);
use App\Models\Wiki\Artist;
use App\Models\Wiki\Song;
use App\Pivots\Wiki\ArtistSong;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
test('artist', function () {
$artistSong = ArtistSong::factory()
->for(Artist::factory())
->for(Song::factory())
->createOne();
$this->assertInstanceOf(BelongsTo::class, $artistSong->artist());
$this->assertInstanceOf(Artist::class, $artistSong->artist()->first());
});
test('song', function () {
$artistSong = ArtistSong::factory()
->for(Artist::factory())
->for(Song::factory())
->createOne();
$this->assertInstanceOf(BelongsTo::class, $artistSong->song());
$this->assertInstanceOf(Song::class, $artistSong->song()->first());
});