koel/tests/Feature/SongSearchTest.php
2024-10-24 17:45:45 +07:00

20 lines
436 B
PHP

<?php
namespace Tests\Feature;
use App\Http\Resources\SongResource;
use App\Models\Song;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;
class SongSearchTest extends TestCase
{
#[Test]
public function search(): void
{
Song::factory(10)->create(['title' => 'A Foo Song']);
$this->getAs('api/search/songs?q=foo')
->assertJsonStructure(['*' => SongResource::JSON_STRUCTURE]);
}
}