koel/tests/Feature/FavoriteSongTest.php
2023-06-05 23:46:41 +02:00

20 lines
445 B
PHP

<?php
namespace Tests\Feature;
use App\Models\Interaction;
use App\Models\User;
class FavoriteSongTest extends TestCase
{
public function testIndex(): void
{
/** @var User $user */
$user = User::factory()->create();
Interaction::factory(5)->for($user)->create(['liked' => true]);
$this->getAs('api/songs/favorite', $user)
->assertJsonStructure(['*' => SongTest::JSON_STRUCTURE]);
}
}