mirror of
https://github.com/koel/koel
synced 2024-11-27 22:40:26 +00:00
27 lines
609 B
PHP
27 lines
609 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Http\Resources\ArtistResource;
|
|
use App\Models\Artist;
|
|
use Tests\TestCase;
|
|
|
|
class ArtistTest extends TestCase
|
|
{
|
|
public function testIndex(): void
|
|
{
|
|
Artist::factory(10)->create();
|
|
|
|
$this->getAs('api/artists')
|
|
->assertJsonStructure(ArtistResource::PAGINATION_JSON_STRUCTURE);
|
|
}
|
|
|
|
public function testShow(): void
|
|
{
|
|
/** @var Artist $artist */
|
|
$artist = Artist::factory()->create();
|
|
|
|
$this->getAs('api/artists/' . $artist->id)
|
|
->assertJsonStructure(ArtistResource::JSON_STRUCTURE);
|
|
}
|
|
}
|