mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
27 lines
596 B
PHP
27 lines
596 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Http\Resources\AlbumResource;
|
|
use App\Models\Album;
|
|
use Tests\TestCase;
|
|
|
|
class AlbumTest extends TestCase
|
|
{
|
|
public function testIndex(): void
|
|
{
|
|
Album::factory(10)->create();
|
|
|
|
$this->getAs('api/albums')
|
|
->assertJsonStructure(AlbumResource::PAGINATION_JSON_STRUCTURE);
|
|
}
|
|
|
|
public function testShow(): void
|
|
{
|
|
/** @var Album $album */
|
|
$album = Album::factory()->create();
|
|
|
|
$this->getAs('api/albums/' . $album->id)
|
|
->assertJsonStructure(AlbumResource::JSON_STRUCTURE);
|
|
}
|
|
}
|