Update test suites.
This commit is contained in:
parent
0a08a6fd4e
commit
c40ddf8375
|
@ -39,6 +39,7 @@ final class UpdateMeilisearchIndex extends AbstractTask
|
||||||
{
|
{
|
||||||
if (!$this->meilisearch->isSupported()) {
|
if (!$this->meilisearch->isSupported()) {
|
||||||
$this->logger->debug('Meilisearch is not supported on this instance. Skipping sync task.');
|
$this->logger->debug('Meilisearch is not supported on this instance. Skipping sync task.');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$storageLocations = $this->iterateStorageLocations(Entity\Enums\StorageLocationTypes::StationMedia);
|
$storageLocations = $this->iterateStorageLocations(Entity\Enums\StorageLocationTypes::StationMedia);
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Functional;
|
|
||||||
|
|
||||||
use App\Entity;
|
|
||||||
|
|
||||||
class Api_RequestsCest extends CestAbstract
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @before setupComplete
|
|
||||||
*/
|
|
||||||
public function checkRequestsAPI(\FunctionalTester $I): void
|
|
||||||
{
|
|
||||||
$I->wantTo('Check request API endpoints.');
|
|
||||||
|
|
||||||
// Enable requests on station.
|
|
||||||
$testStation = $this->getTestStation();
|
|
||||||
$station_id = $testStation->getId();
|
|
||||||
|
|
||||||
$testStation->setEnableRequests(true);
|
|
||||||
$this->em->persist($testStation);
|
|
||||||
$this->em->flush();
|
|
||||||
|
|
||||||
// Upload a test song.
|
|
||||||
$media = $this->uploadTestSong();
|
|
||||||
|
|
||||||
$playlist = new Entity\StationPlaylist($testStation);
|
|
||||||
$playlist->setName('Test Playlist');
|
|
||||||
$this->em->persist($playlist);
|
|
||||||
|
|
||||||
$spm = new Entity\StationPlaylistMedia($playlist, $media);
|
|
||||||
$this->em->persist($spm);
|
|
||||||
|
|
||||||
$this->em->flush();
|
|
||||||
$this->em->clear();
|
|
||||||
|
|
||||||
$I->sendGET('/api/station/' . $station_id . '/requests');
|
|
||||||
|
|
||||||
$I->seeResponseIsJson();
|
|
||||||
$I->seeResponseCodeIs(200);
|
|
||||||
|
|
||||||
$I->sendGET('/api/station/' . $station_id . '/request/' . $media->getUniqueId());
|
|
||||||
|
|
||||||
$I->seeResponseIsJson();
|
|
||||||
$I->seeResponseCodeIs(200);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue