koel/tests/Feature/QueueTest.php

22 lines
530 B
PHP
Raw Normal View History

2022-07-27 09:30:04 +00:00
<?php
2023-06-05 21:46:41 +00:00
namespace Tests\Feature;
2022-07-27 09:30:04 +00:00
use App\Models\Song;
class QueueTest extends TestCase
{
public function testFetchSongs(): void
{
Song::factory(10)->create();
$this->getAs('api/queue/fetch?order=rand&limit=5')
->assertJsonStructure(['*' => SongTest::JSON_STRUCTURE])
->assertJsonCount(5, '*');
$this->getAs('api/queue/fetch?order=asc&sort=title&limit=5')
->assertJsonStructure(['*' => SongTest::JSON_STRUCTURE])
->assertJsonCount(5, '*');
}
}