mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
21 lines
465 B
PHP
21 lines
465 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\Interaction;
|
|
use App\Models\User;
|
|
use Tests\TestCase;
|
|
|
|
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]);
|
|
}
|
|
}
|