4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-17 22:47:04 +00:00
AzuraCast/tests/functional/C02_Station_MediaCest.php

40 lines
1.0 KiB
PHP
Raw Normal View History

<?php
2019-10-11 01:22:02 +00:00
use App\Settings;
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();
// 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)),
]);
$I->seeResponseContainsJson([
'title' => 'AzuraCast is Live!',
'artist' => 'AzuraCast.com',
]);
2019-10-11 01:22:02 +00:00
$I->sendGET('/api/station/' . $station_id . '/files/list');
$I->seeResponseContainsJson([
'media_name' => 'AzuraCast.com - AzuraCast is Live!',
]);
2019-10-11 01:22:02 +00:00
$I->amOnPage('/station/' . $station_id . '/files');
$I->see('Music Files');
}
}