Apply scanning to more files.
This commit is contained in:
parent
0c06451b7f
commit
723e9402ac
15
phpcs.xml
15
phpcs.xml
|
@ -2,13 +2,11 @@
|
||||||
<ruleset name="AzuraCast">
|
<ruleset name="AzuraCast">
|
||||||
<description>The AzuraCast PHP coding standard.</description>
|
<description>The AzuraCast PHP coding standard.</description>
|
||||||
|
|
||||||
<file>bin</file>
|
|
||||||
<file>config</file>
|
<file>config</file>
|
||||||
<file>src</file>
|
<file>src</file>
|
||||||
<file>templates</file>
|
|
||||||
<file>web</file>
|
<file>web</file>
|
||||||
|
<file>tests/Functional</file>
|
||||||
<exclude-pattern>src/Tests/*$</exclude-pattern>
|
<file>tests/Unit</file>
|
||||||
|
|
||||||
<arg name="basepath" value="."/>
|
<arg name="basepath" value="."/>
|
||||||
<arg name="extensions" value="php"/>
|
<arg name="extensions" value="php"/>
|
||||||
|
@ -35,6 +33,15 @@
|
||||||
<exclude-pattern>src/Installer/EnvFiles/*.php</exclude-pattern>
|
<exclude-pattern>src/Installer/EnvFiles/*.php</exclude-pattern>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
|
||||||
|
<exclude-pattern>tests/*$</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
|
||||||
|
<exclude-pattern>src/Tests/Module.php</exclude-pattern>
|
||||||
|
<exclude-pattern>tests/*$</exclude-pattern>
|
||||||
|
</rule>
|
||||||
|
|
||||||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
|
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
|
||||||
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
|
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
|
@ -14,6 +14,10 @@ parameters:
|
||||||
- templates
|
- templates
|
||||||
- web
|
- web
|
||||||
|
|
||||||
|
fileExtensions:
|
||||||
|
- ""
|
||||||
|
- php
|
||||||
|
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- config/routes.dev.php
|
- config/routes.dev.php
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Connector extends AbstractBrowser
|
||||||
$_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
|
$_SERVER['REQUEST_METHOD'] = strtoupper($request->getMethod());
|
||||||
$_SERVER['REQUEST_URI'] = $uri;
|
$_SERVER['REQUEST_URI'] = $uri;
|
||||||
|
|
||||||
$request = (new ServerRequestFactory)->createServerRequestFromGlobals();
|
$request = (new ServerRequestFactory())->createServerRequestFromGlobals();
|
||||||
|
|
||||||
$slimResponse = $this->app->handle($request);
|
$slimResponse = $this->app->handle($request);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Based on Herloct's Slim 3.0 Connector
|
* Based on Herloct's Slim 3.0 Connector
|
||||||
* https://github.com/herloct/codeception-slim-module
|
* https://github.com/herloct/codeception-slim-module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Tests;
|
namespace App\Tests;
|
||||||
|
|
||||||
use App\AppFactory;
|
use App\AppFactory;
|
||||||
|
@ -22,6 +23,7 @@ use Psr\Container\ContainerInterface;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Slim\App;
|
use Slim\App;
|
||||||
|
|
||||||
|
// phpcs:disable PSR2.Methods.MethodDeclaration.Underscore
|
||||||
class Module extends Framework implements DoctrineProvider
|
class Module extends Framework implements DoctrineProvider
|
||||||
{
|
{
|
||||||
public ContainerInterface $container;
|
public ContainerInterface $container;
|
||||||
|
@ -37,6 +39,7 @@ class Module extends Framework implements DoctrineProvider
|
||||||
$this->requiredFields = ['container'];
|
$this->requiredFields = ['container'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function _initialize(): void
|
public function _initialize(): void
|
||||||
{
|
{
|
||||||
$this->app = AppFactory::createApp(
|
$this->app = AppFactory::createApp(
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Admin_DebugCest extends CestAbstract
|
class Admin_DebugCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function syncTasks(\FunctionalTester $I)
|
public function syncTasks(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('Test All Synchronized Tasks');
|
$I->wantTo('Test All Synchronized Tasks');
|
||||||
$I->amOnPage('/admin/debug/sync/all');
|
$I->amOnPage('/admin/debug/sync/all');
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Admin_IndexCest extends CestAbstract
|
class Admin_IndexCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function seeAdminHomepage(\FunctionalTester $I): void
|
public function seeAdminHomepage(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('See the administration homepage.');
|
$I->wantTo('See the administration homepage.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Admin_RecordsCest extends CestAbstract
|
class Admin_RecordsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageUsers(\FunctionalTester $I): void
|
public function manageUsers(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage users.');
|
$I->wantTo('Manage users.');
|
||||||
|
|
||||||
|
@ -52,7 +56,7 @@ class Admin_RecordsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageStations(\FunctionalTester $I): void
|
public function manageStations(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage stations.');
|
$I->wantTo('Manage stations.');
|
||||||
|
|
||||||
|
@ -79,7 +83,7 @@ class Admin_RecordsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageSettings(\FunctionalTester $I): void
|
public function manageSettings(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage settings.');
|
$I->wantTo('Manage settings.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_AuditLogCest extends CestAbstract
|
class Api_Admin_AuditLogCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function viewAuditLog(\FunctionalTester $I): void
|
public function viewAuditLog(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('View audit log via API.');
|
$I->wantTo('View audit log via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_CustomFieldsCest extends CestAbstract
|
class Api_Admin_CustomFieldsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageCustomFields(\FunctionalTester $I): void
|
public function manageCustomFields(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage custom fields via API.');
|
$I->wantTo('Manage custom fields via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Entity\Repository\RolePermissionRepository;
|
use App\Entity\Repository\RolePermissionRepository;
|
||||||
use App\Enums\GlobalPermissions;
|
use App\Enums\GlobalPermissions;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_RolesCest extends CestAbstract
|
class Api_Admin_RolesCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -11,7 +14,7 @@ class Api_Admin_RolesCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageRoles(\FunctionalTester $I): void
|
public function manageRoles(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage roles via API.');
|
$I->wantTo('Manage roles via API.');
|
||||||
|
|
||||||
|
@ -32,7 +35,7 @@ class Api_Admin_RolesCest extends CestAbstract
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkSuperAdminRole(\FunctionalTester $I): void
|
public function checkSuperAdminRole(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Ensure super administrator is not editable.');
|
$I->wantTo('Ensure super administrator is not editable.');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Radio\Enums\FrontendAdapters;
|
use App\Radio\Enums\FrontendAdapters;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_StationsCest extends CestAbstract
|
class Api_Admin_StationsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -10,7 +13,7 @@ class Api_Admin_StationsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageStations(\FunctionalTester $I): void
|
public function manageStations(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage stations via API.');
|
$I->wantTo('Manage stations via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Entity\Enums\StorageLocationAdapters;
|
use App\Entity\Enums\StorageLocationAdapters;
|
||||||
use App\Entity\Enums\StorageLocationTypes;
|
use App\Entity\Enums\StorageLocationTypes;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_StorageLocationsCest extends CestAbstract
|
class Api_Admin_StorageLocationsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -11,7 +14,7 @@ class Api_Admin_StorageLocationsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageStorageLocations(\FunctionalTester $I): void
|
public function manageStorageLocations(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage storage locations via API.');
|
$I->wantTo('Manage storage locations via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Admin_UsersCest extends CestAbstract
|
class Api_Admin_UsersCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageUsers(\FunctionalTester $I): void
|
public function manageUsers(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage users via API.');
|
$I->wantTo('Manage users via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Frontend_AccountCest extends CestAbstract
|
class Api_Frontend_AccountCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function checkAccount(\FunctionalTester $I): void
|
public function checkAccount(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Check frontend account API functions.');
|
$I->wantTo('Check frontend account API functions.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Frontend_DashboardCest extends CestAbstract
|
class Api_Frontend_DashboardCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function checkDashboard(\FunctionalTester $I): void
|
public function checkDashboard(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Check dashboard API functions.');
|
$I->wantTo('Check dashboard API functions.');
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_IndexCest extends CestAbstract
|
class Api_IndexCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
*/
|
*/
|
||||||
public function checkApiIndex(\FunctionalTester $I): void
|
public function checkApiIndex(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Check basic API functions.');
|
$I->wantTo('Check basic API functions.');
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_StationsCest extends CestAbstract
|
class Api_StationsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
*/
|
*/
|
||||||
public function checkApiStation(\FunctionalTester $I): void
|
public function checkApiStation(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Check station API endpoints.');
|
$I->wantTo('Check station API endpoints.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_MountsCest extends CestAbstract
|
class Api_Stations_MountsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageMounts(\FunctionalTester $I): void
|
public function manageMounts(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station mount points via API.');
|
$I->wantTo('Manage station mount points via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Entity\Enums\PlaylistSources;
|
use App\Entity\Enums\PlaylistSources;
|
||||||
use App\Entity\Enums\PlaylistTypes;
|
use App\Entity\Enums\PlaylistTypes;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_PlaylistsCest extends CestAbstract
|
class Api_Stations_PlaylistsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -11,7 +14,7 @@ class Api_Stations_PlaylistsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function managePlaylists(\FunctionalTester $I): void
|
public function managePlaylists(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station playlists via API.');
|
$I->wantTo('Manage station playlists via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_PodcastsCest extends CestAbstract
|
class Api_Stations_PodcastsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function managePodcasts(\FunctionalTester $I): void
|
public function managePodcasts(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station podcasts via API.');
|
$I->wantTo('Manage station podcasts via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Radio\Enums\RemoteAdapters;
|
use App\Radio\Enums\RemoteAdapters;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_RemotesCest extends CestAbstract
|
class Api_Stations_RemotesCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -10,7 +13,7 @@ class Api_Stations_RemotesCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageRemotes(\FunctionalTester $I): void
|
public function manageRemotes(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station remote relays via API.');
|
$I->wantTo('Manage station remote relays via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use Codeception\Util\Shared\Asserts;
|
use Codeception\Util\Shared\Asserts;
|
||||||
|
use DateInterval;
|
||||||
|
use DateTime;
|
||||||
|
use FunctionalTester;
|
||||||
use League\Csv\Reader;
|
use League\Csv\Reader;
|
||||||
|
|
||||||
class Api_Stations_ReportsCest extends CestAbstract
|
class Api_Stations_ReportsCest extends CestAbstract
|
||||||
|
@ -13,7 +18,7 @@ class Api_Stations_ReportsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function viewReports(\FunctionalTester $I): void
|
public function viewReports(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('View various station reports via API.');
|
$I->wantTo('View various station reports via API.');
|
||||||
|
|
||||||
|
@ -40,23 +45,23 @@ class Api_Stations_ReportsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function downloadListenerReportsCsv(\FunctionalTester $I): void
|
public function downloadListenerReportsCsv(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Download station listener report CSV via API.');
|
$I->wantTo('Download station listener report CSV via API.');
|
||||||
|
|
||||||
$station = $this->getTestStation();
|
$station = $this->getTestStation();
|
||||||
$uriBase = '/api/station/' . $station->getId();
|
$uriBase = '/api/station/' . $station->getId();
|
||||||
|
|
||||||
$startDateTime = (new \DateTime())->sub(\DateInterval::createFromDateString('30 days'));
|
$startDateTime = (new DateTime())->sub(DateInterval::createFromDateString('30 days'));
|
||||||
$endDateTime = new \DateTime();
|
$endDateTime = new DateTime();
|
||||||
|
|
||||||
$requestUrl = $uriBase . '/listeners?' . http_build_query(
|
$requestUrl = $uriBase . '/listeners?' . http_build_query(
|
||||||
[
|
[
|
||||||
'format' => 'csv',
|
'format' => 'csv',
|
||||||
'start' => $startDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
'start' => $startDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
||||||
'end' => $endDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
'end' => $endDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$csvHeaders = [
|
$csvHeaders = [
|
||||||
'IP',
|
'IP',
|
||||||
|
@ -87,23 +92,23 @@ class Api_Stations_ReportsCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function downloadHistoryReportCsv(\FunctionalTester $I): void
|
public function downloadHistoryReportCsv(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Download station timeline report CSV via API.');
|
$I->wantTo('Download station timeline report CSV via API.');
|
||||||
|
|
||||||
$station = $this->getTestStation();
|
$station = $this->getTestStation();
|
||||||
$uriBase = '/api/station/' . $station->getId();
|
$uriBase = '/api/station/' . $station->getId();
|
||||||
|
|
||||||
$startDateTime = (new \DateTime())->sub(\DateInterval::createFromDateString('30 days'));
|
$startDateTime = (new DateTime())->sub(DateInterval::createFromDateString('30 days'));
|
||||||
$endDateTime = new \DateTime();
|
$endDateTime = new DateTime();
|
||||||
|
|
||||||
$requestUrl = $uriBase . '/history?' . http_build_query(
|
$requestUrl = $uriBase . '/history?' . http_build_query(
|
||||||
[
|
[
|
||||||
'format' => 'csv',
|
'format' => 'csv',
|
||||||
'start' => $startDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
'start' => $startDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
||||||
'end' => $endDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
'end' => $endDateTime->format('Y-m-d\TH:i:s.v\Z'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$csvHeaders = [
|
$csvHeaders = [
|
||||||
'Date',
|
'Date',
|
||||||
|
@ -120,7 +125,7 @@ class Api_Stations_ReportsCest extends CestAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function testReportCsv(
|
protected function testReportCsv(
|
||||||
\FunctionalTester $I,
|
FunctionalTester $I,
|
||||||
string $url,
|
string $url,
|
||||||
array $headerFields
|
array $headerFields
|
||||||
): void {
|
): void {
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_StreamersCest extends CestAbstract
|
class Api_Stations_StreamersCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageStreamers(\FunctionalTester $I): void
|
public function manageStreamers(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station streamers via API.');
|
$I->wantTo('Manage station streamers via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Webhook\Enums\WebhookTypes;
|
use App\Webhook\Enums\WebhookTypes;
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Api_Stations_WebhooksCest extends CestAbstract
|
class Api_Stations_WebhooksCest extends CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -10,7 +13,7 @@ class Api_Stations_WebhooksCest extends CestAbstract
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function manageWebhooks(\FunctionalTester $I): void
|
public function manageWebhooks(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Manage station webhooks via API.');
|
$I->wantTo('Manage station webhooks via API.');
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
use App\Acl;
|
use App\Acl;
|
||||||
use App\Doctrine\ReloadableEntityManagerInterface;
|
use App\Doctrine\ReloadableEntityManagerInterface;
|
||||||
|
use App\Entity\ApiKey;
|
||||||
use App\Entity\Repository\SettingsRepository;
|
use App\Entity\Repository\SettingsRepository;
|
||||||
use App\Entity\Repository\StationRepository;
|
use App\Entity\Repository\StationRepository;
|
||||||
|
use App\Entity\Repository\StorageLocationRepository;
|
||||||
|
use App\Entity\Role;
|
||||||
|
use App\Entity\RolePermission;
|
||||||
|
use App\Entity\Settings;
|
||||||
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationMedia;
|
||||||
|
use App\Entity\User;
|
||||||
use App\Enums\GlobalPermissions;
|
use App\Enums\GlobalPermissions;
|
||||||
use App\Environment;
|
use App\Environment;
|
||||||
use App\Media\MediaProcessor;
|
use App\Media\MediaProcessor;
|
||||||
use App\Security\SplitToken;
|
use App\Security\SplitToken;
|
||||||
use App\Tests\Module;
|
use App\Tests\Module;
|
||||||
|
use FunctionalTester;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
use RuntimeException;
|
||||||
|
|
||||||
abstract class CestAbstract
|
abstract class CestAbstract
|
||||||
{
|
{
|
||||||
|
@ -30,7 +42,7 @@ abstract class CestAbstract
|
||||||
|
|
||||||
protected ?string $login_api_key = null;
|
protected ?string $login_api_key = null;
|
||||||
|
|
||||||
private ?\App\Entity\Station $test_station = null;
|
private ?Station $test_station = null;
|
||||||
|
|
||||||
protected function _inject(Module $testsModule): void
|
protected function _inject(Module $testsModule): void
|
||||||
{
|
{
|
||||||
|
@ -42,7 +54,7 @@ abstract class CestAbstract
|
||||||
$this->environment = $this->di->get(Environment::class);
|
$this->environment = $this->di->get(Environment::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _after(\FunctionalTester $I): void
|
public function _after(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$this->em->clear();
|
$this->em->clear();
|
||||||
|
|
||||||
|
@ -53,7 +65,7 @@ abstract class CestAbstract
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupIncomplete(\FunctionalTester $I): void
|
protected function setupIncomplete(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Start with an incomplete setup.');
|
$I->wantTo('Start with an incomplete setup.');
|
||||||
|
|
||||||
|
@ -65,7 +77,7 @@ abstract class CestAbstract
|
||||||
$this->settingsRepo->writeSettings($settings);
|
$this->settingsRepo->writeSettings($settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupComplete(\FunctionalTester $I): void
|
protected function setupComplete(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$this->_cleanTables();
|
$this->_cleanTables();
|
||||||
|
|
||||||
|
@ -76,19 +88,19 @@ abstract class CestAbstract
|
||||||
$this->setupCompleteSettings($I);
|
$this->setupCompleteSettings($I);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupCompleteUser(\FunctionalTester $I): void
|
protected function setupCompleteUser(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
// Create administrator account.
|
// Create administrator account.
|
||||||
$role = new \App\Entity\Role;
|
$role = new Role();
|
||||||
$role->setName('Super Administrator');
|
$role->setName('Super Administrator');
|
||||||
$this->em->persist($role);
|
$this->em->persist($role);
|
||||||
|
|
||||||
$rha = new \App\Entity\RolePermission($role);
|
$rha = new RolePermission($role);
|
||||||
$rha->setActionName(GlobalPermissions::All);
|
$rha->setActionName(GlobalPermissions::All);
|
||||||
$this->em->persist($rha);
|
$this->em->persist($rha);
|
||||||
|
|
||||||
// Create user account.
|
// Create user account.
|
||||||
$user = new \App\Entity\User;
|
$user = new User();
|
||||||
$user->setName('AzuraCast Test User');
|
$user->setName('AzuraCast Test User');
|
||||||
$user->setEmail($this->login_username);
|
$user->setEmail($this->login_username);
|
||||||
$user->setNewPassword($this->login_password);
|
$user->setNewPassword($this->login_password);
|
||||||
|
@ -100,7 +112,7 @@ abstract class CestAbstract
|
||||||
// Create API key
|
// Create API key
|
||||||
$key = SplitToken::generate();
|
$key = SplitToken::generate();
|
||||||
|
|
||||||
$apiKey = new \App\Entity\ApiKey($user, $key);
|
$apiKey = new ApiKey($user, $key);
|
||||||
$apiKey->setComment('Test Suite');
|
$apiKey->setComment('Test Suite');
|
||||||
|
|
||||||
$this->em->persist($apiKey);
|
$this->em->persist($apiKey);
|
||||||
|
@ -112,7 +124,7 @@ abstract class CestAbstract
|
||||||
$this->di->get(Acl::class)->reload();
|
$this->di->get(Acl::class)->reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupCompleteStations(\FunctionalTester $I): void
|
protected function setupCompleteStations(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->sendPost(
|
$I->sendPost(
|
||||||
'/api/admin/stations',
|
'/api/admin/stations',
|
||||||
|
@ -123,34 +135,34 @@ abstract class CestAbstract
|
||||||
);
|
);
|
||||||
|
|
||||||
$stationId = $I->grabDataFromResponseByJsonPath('id');
|
$stationId = $I->grabDataFromResponseByJsonPath('id');
|
||||||
$this->test_station = $this->em->find(\App\Entity\Station::class, $stationId[0]);
|
$this->test_station = $this->em->find(Station::class, $stationId[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupCompleteSettings(\FunctionalTester $I): void
|
protected function setupCompleteSettings(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->sendPut(
|
$I->sendPut(
|
||||||
'/api/admin/settings/' . \App\Entity\Settings::GROUP_GENERAL,
|
'/api/admin/settings/' . Settings::GROUP_GENERAL,
|
||||||
[
|
[
|
||||||
'base_url' => 'http://localhost',
|
'base_url' => 'http://localhost',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTestStation(): \App\Entity\Station
|
protected function getTestStation(): Station
|
||||||
{
|
{
|
||||||
if ($this->test_station instanceof \App\Entity\Station) {
|
if ($this->test_station instanceof Station) {
|
||||||
$testStation = $this->em->refetch($this->test_station);
|
$testStation = $this->em->refetch($this->test_station);
|
||||||
if ($testStation instanceof \App\Entity\Station) {
|
if ($testStation instanceof Station) {
|
||||||
return $testStation;
|
return $testStation;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->test_station = null;
|
$this->test_station = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \RuntimeException('Test station is not established.');
|
throw new RuntimeException('Test station is not established.');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function uploadTestSong(): \App\Entity\StationMedia
|
protected function uploadTestSong(): StationMedia
|
||||||
{
|
{
|
||||||
$testStation = $this->getTestStation();
|
$testStation = $this->getTestStation();
|
||||||
|
|
||||||
|
@ -158,9 +170,9 @@ abstract class CestAbstract
|
||||||
|
|
||||||
$storageLocation = $testStation->getMediaStorageLocation();
|
$storageLocation = $testStation->getMediaStorageLocation();
|
||||||
|
|
||||||
$storageLocationRepo = $this->di->get(\App\Entity\Repository\StorageLocationRepository::class);
|
$storageLocationRepo = $this->di->get(StorageLocationRepository::class);
|
||||||
$storageFs = $storageLocationRepo->getAdapter($storageLocation)->getFilesystem();
|
$storageFs = $storageLocationRepo->getAdapter($storageLocation)->getFilesystem();
|
||||||
|
|
||||||
$storageFs->upload($songSrc, 'test.mp3');
|
$storageFs->upload($songSrc, 'test.mp3');
|
||||||
|
|
||||||
/** @var MediaProcessor $mediaProcessor */
|
/** @var MediaProcessor $mediaProcessor */
|
||||||
|
@ -172,10 +184,10 @@ abstract class CestAbstract
|
||||||
protected function _cleanTables(): void
|
protected function _cleanTables(): void
|
||||||
{
|
{
|
||||||
$cleanTables = [
|
$cleanTables = [
|
||||||
\App\Entity\User::class,
|
User::class,
|
||||||
\App\Entity\Role::class,
|
Role::class,
|
||||||
\App\Entity\Station::class,
|
Station::class,
|
||||||
\App\Entity\Settings::class,
|
Settings::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($cleanTables as $cleanTable) {
|
foreach ($cleanTables as $cleanTable) {
|
||||||
|
@ -185,7 +197,7 @@ abstract class CestAbstract
|
||||||
$this->em->clear();
|
$this->em->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function login(\FunctionalTester $I): void
|
protected function login(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$this->setupComplete($I);
|
$this->setupComplete($I);
|
||||||
|
|
||||||
|
@ -204,7 +216,7 @@ abstract class CestAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function testCrudApi(
|
protected function testCrudApi(
|
||||||
\FunctionalTester $I,
|
FunctionalTester $I,
|
||||||
string $listUrl,
|
string $listUrl,
|
||||||
array $createJson = [],
|
array $createJson = [],
|
||||||
array $editJson = []
|
array $editJson = []
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Frontend_ErrorCest extends CestAbstract
|
class Frontend_ErrorCest extends CestAbstract
|
||||||
{
|
{
|
||||||
public function seeErrorPages(\FunctionalTester $I): void
|
public function seeErrorPages(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Verify error code pages.');
|
$I->wantTo('Verify error code pages.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Frontend_IndexCest extends CestAbstract
|
class Frontend_IndexCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function seeHomepage(\FunctionalTester $I): void
|
public function seeHomepage(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('See the proper data on the homepage.');
|
$I->wantTo('See the proper data on the homepage.');
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Frontend_PublicCest extends CestAbstract
|
class Frontend_PublicCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
*/
|
*/
|
||||||
public function seePublicPage(\FunctionalTester $I): void
|
public function seePublicPage(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Verify that the public page displays.');
|
$I->wantTo('Verify that the public page displays.');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Frontend_SetupCest extends CestAbstract
|
class Frontend_SetupCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +14,7 @@ class Frontend_SetupCest extends CestAbstract
|
||||||
* @after setupStation
|
* @after setupStation
|
||||||
* @after setupSettings
|
* @after setupSettings
|
||||||
*/
|
*/
|
||||||
public function setupStart(\FunctionalTester $I): void
|
public function setupStart(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Complete the initial setup process.');
|
$I->wantTo('Complete the initial setup process.');
|
||||||
|
|
||||||
|
@ -22,7 +26,7 @@ class Frontend_SetupCest extends CestAbstract
|
||||||
$I->comment('Setup redirect found.');
|
$I->comment('Setup redirect found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupRegister(\FunctionalTester $I): void
|
protected function setupRegister(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->amOnPage('/setup');
|
$I->amOnPage('/setup');
|
||||||
|
|
||||||
|
@ -42,7 +46,7 @@ class Frontend_SetupCest extends CestAbstract
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupStation(\FunctionalTester $I): void
|
protected function setupStation(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->amOnPage('/setup');
|
$I->amOnPage('/setup');
|
||||||
$I->seeCurrentUrlEquals('/setup/station');
|
$I->seeCurrentUrlEquals('/setup/station');
|
||||||
|
@ -51,7 +55,7 @@ class Frontend_SetupCest extends CestAbstract
|
||||||
$this->setupCompleteStations($I);
|
$this->setupCompleteStations($I);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setupSettings(\FunctionalTester $I): void
|
protected function setupSettings(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->amOnPage('/setup');
|
$I->amOnPage('/setup');
|
||||||
$I->seeCurrentUrlEquals('/setup/settings');
|
$I->seeCurrentUrlEquals('/setup/settings');
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_MediaCest extends CestAbstract
|
class Station_MediaCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function editMedia(\FunctionalTester $I): void
|
public function editMedia(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Upload a song to a station.');
|
$I->wantTo('Upload a song to a station.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_MountPointsCest extends CestAbstract
|
class Station_MountPointsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function editMountPoints(\FunctionalTester $I): void
|
public function editMountPoints(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$testStation = $this->getTestStation();
|
$testStation = $this->getTestStation();
|
||||||
$stationId = $testStation->getId();
|
$stationId = $testStation->getId();
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_PlaylistsCest extends CestAbstract
|
class Station_PlaylistsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function editPlaylists(\FunctionalTester $I): void
|
public function editPlaylists(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('Create a station playlist.');
|
$I->wantTo('Create a station playlist.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_ProfileCest extends CestAbstract
|
class Station_ProfileCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function editStationProfile(\FunctionalTester $I): void
|
public function editStationProfile(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('View and edit a station profile.');
|
$I->wantTo('View and edit a station profile.');
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_RemoteRelaysCest extends CestAbstract
|
class Station_RemoteRelaysCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function editRemoteRelays(\FunctionalTester $I): void
|
public function editRemoteRelays(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$testStation = $this->getTestStation();
|
$testStation = $this->getTestStation();
|
||||||
$stationId = $testStation->getId();
|
$stationId = $testStation->getId();
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Functional;
|
namespace Functional;
|
||||||
|
|
||||||
|
use FunctionalTester;
|
||||||
|
|
||||||
class Station_ReportsCest extends CestAbstract
|
class Station_ReportsCest extends CestAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @before setupComplete
|
* @before setupComplete
|
||||||
* @before login
|
* @before login
|
||||||
*/
|
*/
|
||||||
public function viewReports(\FunctionalTester $I): void
|
public function viewReports(FunctionalTester $I): void
|
||||||
{
|
{
|
||||||
$I->wantTo('View station reports.');
|
$I->wantTo('View station reports.');
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
/* Placeholder */
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/* Placeholder */
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Unit;
|
namespace Unit;
|
||||||
|
|
||||||
use App\Entity\Api\StationPlaylistQueue;
|
use App\Entity\Api\StationPlaylistQueue;
|
||||||
use App\Radio\AutoDJ\DuplicatePrevention;
|
use App\Radio\AutoDJ\DuplicatePrevention;
|
||||||
use App\Tests\Module;
|
use App\Tests\Module;
|
||||||
use Codeception\Test\Unit;
|
use Codeception\Test\Unit;
|
||||||
|
use UnitTester;
|
||||||
|
|
||||||
class DuplicatePreventionTest extends Unit
|
class DuplicatePreventionTest extends Unit
|
||||||
{
|
{
|
||||||
protected \UnitTester $tester;
|
protected UnitTester $tester;
|
||||||
|
|
||||||
protected DuplicatePrevention $duplicatePrevention;
|
protected DuplicatePrevention $duplicatePrevention;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Unit;
|
namespace Unit;
|
||||||
|
|
||||||
|
use App\Entity\Listener;
|
||||||
use Carbon\CarbonImmutable;
|
use Carbon\CarbonImmutable;
|
||||||
use Codeception\Test\Unit;
|
use Codeception\Test\Unit;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
|
@ -32,6 +35,6 @@ class ListenerIntervalTest extends Unit
|
||||||
];
|
];
|
||||||
|
|
||||||
$expected = 6 * 60 * 60;
|
$expected = 6 * 60 * 60;
|
||||||
self::assertEquals($expected, \App\Entity\Listener::getListenerSeconds($intervals));
|
self::assertEquals($expected, Listener::getListenerSeconds($intervals));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Unit;
|
namespace Unit;
|
||||||
|
|
||||||
|
use App\Entity\Enums\PlaylistTypes;
|
||||||
|
use App\Entity\Station;
|
||||||
|
use App\Entity\StationPlaylist;
|
||||||
|
use App\Entity\StationSchedule;
|
||||||
use App\Radio\AutoDJ\Scheduler;
|
use App\Radio\AutoDJ\Scheduler;
|
||||||
use App\Tests\Module;
|
use App\Tests\Module;
|
||||||
use Carbon\CarbonImmutable;
|
use Carbon\CarbonImmutable;
|
||||||
|
@ -24,14 +30,14 @@ class StationPlaylistTest extends Unit
|
||||||
|
|
||||||
public function testScheduledPlaylist(): void
|
public function testScheduledPlaylist(): void
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\Station $station */
|
/** @var Station $station */
|
||||||
$station = Mockery::mock(\App\Entity\Station::class);
|
$station = Mockery::mock(Station::class);
|
||||||
|
|
||||||
$playlist = new \App\Entity\StationPlaylist($station);
|
$playlist = new StationPlaylist($station);
|
||||||
$playlist->setName('Test Playlist');
|
$playlist->setName('Test Playlist');
|
||||||
|
|
||||||
// Sample playlist that plays from 10PM to 4AM the next day.
|
// Sample playlist that plays from 10PM to 4AM the next day.
|
||||||
$scheduleEntry = new \App\Entity\StationSchedule($playlist);
|
$scheduleEntry = new StationSchedule($playlist);
|
||||||
$scheduleEntry->setStartTime(2200);
|
$scheduleEntry->setStartTime(2200);
|
||||||
$scheduleEntry->setEndTime(400);
|
$scheduleEntry->setEndTime(400);
|
||||||
$scheduleEntry->setDays([1, 2, 3]); // Monday, Tuesday, Wednesday
|
$scheduleEntry->setDays([1, 2, 3]); // Monday, Tuesday, Wednesday
|
||||||
|
@ -65,12 +71,12 @@ class StationPlaylistTest extends Unit
|
||||||
|
|
||||||
public function testOncePerXMinutesPlaylist()
|
public function testOncePerXMinutesPlaylist()
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\Station $station */
|
/** @var Station $station */
|
||||||
$station = Mockery::mock(\App\Entity\Station::class);
|
$station = Mockery::mock(Station::class);
|
||||||
|
|
||||||
$playlist = new \App\Entity\StationPlaylist($station);
|
$playlist = new StationPlaylist($station);
|
||||||
$playlist->setName('Test Playlist');
|
$playlist->setName('Test Playlist');
|
||||||
$playlist->setType(\App\Entity\Enums\PlaylistTypes::OncePerXMinutes);
|
$playlist->setType(PlaylistTypes::OncePerXMinutes);
|
||||||
$playlist->setPlayPerMinutes(30);
|
$playlist->setPlayPerMinutes(30);
|
||||||
|
|
||||||
$utc = new DateTimeZone('UTC');
|
$utc = new DateTimeZone('UTC');
|
||||||
|
@ -91,12 +97,12 @@ class StationPlaylistTest extends Unit
|
||||||
|
|
||||||
public function testOncePerHourPlaylist()
|
public function testOncePerHourPlaylist()
|
||||||
{
|
{
|
||||||
/** @var \App\Entity\Station $station */
|
/** @var Station $station */
|
||||||
$station = Mockery::mock(\App\Entity\Station::class);
|
$station = Mockery::mock(Station::class);
|
||||||
|
|
||||||
$playlist = new \App\Entity\StationPlaylist($station);
|
$playlist = new StationPlaylist($station);
|
||||||
$playlist->setName('Test Playlist');
|
$playlist->setName('Test Playlist');
|
||||||
$playlist->setType(\App\Entity\Enums\PlaylistTypes::OncePerHour);
|
$playlist->setType(PlaylistTypes::OncePerHour);
|
||||||
$playlist->setPlayPerHourMinute(50);
|
$playlist->setPlayPerHourMinute(50);
|
||||||
|
|
||||||
$utc = new DateTimeZone('UTC');
|
$utc = new DateTimeZone('UTC');
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Unit;
|
namespace Unit;
|
||||||
|
|
||||||
use App\Utilities\Strings;
|
use App\Utilities\Strings;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Unit;
|
namespace Unit;
|
||||||
|
|
||||||
use App\Xml\Reader;
|
use App\Xml\Reader;
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
// Here you can initialize variables that will be available to your tests
|
// Here you can initialize variables that will be available to your tests
|
||||||
|
|
Loading…
Reference in New Issue