koel/tests/Feature/V6/FavoriteTest.php
2022-07-27 10:49:33 +02:00

22 lines
457 B
PHP

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