2016-11-08 16:32:15 +00:00
|
|
|
<?php
|
2020-06-26 20:22:53 +00:00
|
|
|
|
2022-03-17 00:04:40 +00:00
|
|
|
namespace Functional;
|
|
|
|
|
2021-06-12 08:40:01 +00:00
|
|
|
class Frontend_PublicCest extends CestAbstract
|
2016-11-08 16:32:15 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
*/
|
2022-03-17 00:04:40 +00:00
|
|
|
public function seePublicPage(\FunctionalTester $I): void
|
2016-11-08 16:32:15 +00:00
|
|
|
{
|
|
|
|
$I->wantTo('Verify that the public page displays.');
|
|
|
|
|
2021-06-14 04:49:17 +00:00
|
|
|
// Disable public pages
|
2020-06-26 20:22:53 +00:00
|
|
|
$testStation = $this->getTestStation();
|
2021-06-14 04:49:17 +00:00
|
|
|
$testStation->setEnablePublicPage(false);
|
|
|
|
$this->em->persist($testStation);
|
|
|
|
$this->em->flush();
|
2020-06-26 20:22:53 +00:00
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId());
|
2021-06-14 04:49:17 +00:00
|
|
|
$I->seeResponseCodeIs(500);
|
2016-11-08 16:32:15 +00:00
|
|
|
|
2021-06-14 04:49:17 +00:00
|
|
|
// Enable public pages
|
|
|
|
$testStation = $this->getTestStation();
|
|
|
|
$testStation->setEnablePublicPage(true);
|
|
|
|
$this->em->persist($testStation);
|
|
|
|
$this->em->flush();
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId());
|
|
|
|
$I->seeResponseCodeIs(200);
|
2020-06-26 20:22:53 +00:00
|
|
|
$I->see($testStation->getName());
|
2021-06-14 04:49:17 +00:00
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/embed');
|
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/history');
|
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/playlist.pls');
|
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/playlist.m3u');
|
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
|
|
|
|
// Disable WebDJ
|
|
|
|
$testStation = $this->getTestStation();
|
|
|
|
$testStation->setEnableStreamers(false);
|
|
|
|
$this->em->persist($testStation);
|
|
|
|
$this->em->flush();
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/dj');
|
|
|
|
$I->seeResponseCodeIs(500);
|
|
|
|
|
|
|
|
// Enable WebDJ
|
|
|
|
$testStation = $this->getTestStation();
|
|
|
|
$testStation->setEnableStreamers(true);
|
|
|
|
$this->em->persist($testStation);
|
|
|
|
$this->em->flush();
|
|
|
|
|
|
|
|
$I->amOnPage('/public/' . $testStation->getId() . '/dj');
|
|
|
|
$I->seeResponseCodeIs(200);
|
2016-11-08 16:32:15 +00:00
|
|
|
}
|
2021-06-12 08:40:01 +00:00
|
|
|
}
|