2022-07-27 10:04:04 +00:00
|
|
|
<?php
|
|
|
|
|
2023-06-05 21:46:41 +00:00
|
|
|
namespace Tests\Feature;
|
2022-07-27 10:04:04 +00:00
|
|
|
|
2024-01-25 16:21:26 +00:00
|
|
|
use App\Http\Resources\SongResource;
|
2022-07-27 10:04:04 +00:00
|
|
|
use App\Models\Song;
|
2024-01-09 18:34:40 +00:00
|
|
|
use Tests\TestCase;
|
2022-07-27 10:04:04 +00:00
|
|
|
|
|
|
|
class SongSearchTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testSearch(): void
|
|
|
|
{
|
|
|
|
Song::factory(10)->create(['title' => 'A Foo Song']);
|
|
|
|
|
|
|
|
$this->getAs('api/search/songs?q=foo')
|
2024-01-25 16:21:26 +00:00
|
|
|
->assertJsonStructure(['*' => SongResource::JSON_STRUCTURE]);
|
2022-07-27 10:04:04 +00:00
|
|
|
}
|
|
|
|
}
|