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

30 lines
673 B
PHP

<?php
namespace Tests\Feature\V6;
use App\Models\Interaction;
class PlayCountTest extends TestCase
{
public function testStore(): void
{
/** @var Interaction $interaction */
$interaction = Interaction::factory()->create([
'play_count' => 10,
]);
$response = $this->postAs('/api/interaction/play', [
'song' => $interaction->song->id,
], $interaction->user);
$response->assertJsonStructure([
'type',
'id',
'song_id',
'liked',
'play_count',
]);
self::assertEquals(11, $interaction->refresh()->play_count);
}
}