koel/tests/Feature/V6/ArtistSongTest.php

21 lines
439 B
PHP
Raw Normal View History

2022-07-26 20:23:34 +00:00
<?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();
2022-07-27 08:49:33 +00:00
Song::factory(5)->for($artist)->create();
2022-07-26 20:23:34 +00:00
2022-07-27 08:49:33 +00:00
$this->getAs('api/artists/' . $artist->id . '/songs')
2022-07-26 20:23:34 +00:00
->assertJsonStructure(['*' => SongTest::JSON_STRUCTURE]);
}
}