2019-08-09 16:52:56 +00:00
|
|
|
<?php
|
2019-10-11 01:22:02 +00:00
|
|
|
|
2022-03-17 00:04:40 +00:00
|
|
|
namespace Functional;
|
|
|
|
|
2021-06-12 08:40:01 +00:00
|
|
|
class Station_MediaCest extends CestAbstract
|
2019-08-09 16:52:56 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
* @before login
|
|
|
|
*/
|
2022-03-17 00:04:40 +00:00
|
|
|
public function editMedia(\FunctionalTester $I): void
|
2019-08-09 16:52:56 +00:00
|
|
|
{
|
|
|
|
$I->wantTo('Upload a song to a station.');
|
|
|
|
|
2020-06-26 20:22:53 +00:00
|
|
|
$testStation = $this->getTestStation();
|
|
|
|
$station_id = $testStation->getId();
|
2019-08-09 16:52:56 +00:00
|
|
|
|
2020-06-16 11:00:16 +00:00
|
|
|
// Upload test song
|
2020-12-06 11:57:39 +00:00
|
|
|
$test_song_orig = $this->environment->getBaseDirectory() . '/resources/error.mp3';
|
2021-01-02 09:05:44 +00:00
|
|
|
$I->sendPOST(
|
|
|
|
'/api/station/' . $station_id . '/files',
|
|
|
|
[
|
|
|
|
'path' => 'error.mp3',
|
|
|
|
'file' => base64_encode(file_get_contents($test_song_orig)),
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
$I->seeResponseContainsJson(
|
|
|
|
[
|
|
|
|
'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
|
|
|
|
2021-01-02 09:05:44 +00:00
|
|
|
$I->seeResponseContainsJson(
|
|
|
|
[
|
|
|
|
'text' => 'AzuraCast.com - AzuraCast is Live!',
|
|
|
|
]
|
|
|
|
);
|
2019-08-09 16:52:56 +00:00
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
}
|