2019-08-09 16:52:56 +00:00
|
|
|
<?php
|
2019-10-11 01:22:02 +00:00
|
|
|
|
2020-06-16 11:00:16 +00:00
|
|
|
use App\Settings;
|
|
|
|
|
2019-08-09 16:52:56 +00:00
|
|
|
class C02_Station_MediaCest extends CestAbstract
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
* @before login
|
|
|
|
*/
|
|
|
|
public function editMedia(FunctionalTester $I)
|
|
|
|
{
|
|
|
|
$I->wantTo('Upload a song to a station.');
|
|
|
|
|
|
|
|
$station_id = $this->test_station->getId();
|
|
|
|
|
2020-06-16 11:00:16 +00:00
|
|
|
// Upload test song
|
|
|
|
$test_song_orig = $this->settings[Settings::BASE_DIR] . '/resources/error.mp3';
|
|
|
|
$I->sendPOST('/api/station/' . $station_id . '/files', [
|
|
|
|
'path' => 'error.mp3',
|
|
|
|
'file' => base64_encode(file_get_contents($test_song_orig)),
|
2019-08-09 16:52:56 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
$I->seeResponseContainsJson([
|
2020-06-16 11:00:16 +00:00
|
|
|
'title' => 'AzuraCast is Live!',
|
|
|
|
'artist' => 'AzuraCast.com',
|
2019-08-09 16:52:56 +00:00
|
|
|
]);
|
|
|
|
|
2019-10-11 01:22:02 +00:00
|
|
|
$I->sendGET('/api/station/' . $station_id . '/files/list');
|
2019-08-09 16:52:56 +00:00
|
|
|
|
|
|
|
$I->seeResponseContainsJson([
|
|
|
|
'media_name' => 'AzuraCast.com - AzuraCast is Live!',
|
|
|
|
]);
|
|
|
|
|
2019-10-11 01:22:02 +00:00
|
|
|
$I->amOnPage('/station/' . $station_id . '/files');
|
2019-08-09 16:52:56 +00:00
|
|
|
|
|
|
|
$I->see('Music Files');
|
|
|
|
}
|
|
|
|
}
|