Update test suites.

This commit is contained in:
Buster Neece 2023-01-29 23:59:42 -06:00
parent 0a08a6fd4e
commit c40ddf8375
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
2 changed files with 1 additions and 47 deletions

View File

@ -39,6 +39,7 @@ final class UpdateMeilisearchIndex extends AbstractTask
{
if (!$this->meilisearch->isSupported()) {
$this->logger->debug('Meilisearch is not supported on this instance. Skipping sync task.');
return;
}
$storageLocations = $this->iterateStorageLocations(Entity\Enums\StorageLocationTypes::StationMedia);

View File

@ -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);
}
}