koel/tests/Feature/V6/ArtistSongTest.php
2022-07-27 10:49:33 +02:00

20 lines
439 B
PHP

<?php
namespace Tests\Feature\V6;
use App\Models\Artist;
use App\Models\Song;
class ArtistSongTest extends TestCase
{
public function testIndex(): void
{
/** @var Artist $artist */
$artist = Artist::factory()->create();
Song::factory(5)->for($artist)->create();
$this->getAs('api/artists/' . $artist->id . '/songs')
->assertJsonStructure(['*' => SongTest::JSON_STRUCTURE]);
}
}