koel/tests/Feature/SongSearchTest.php

19 lines
389 B
PHP
Raw Normal View History

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
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')
->assertJsonStructure(['*' => SongResource::JSON_STRUCTURE]);
2022-07-27 10:04:04 +00:00
}
}