Composer dependency update and code style fixes from new test suites.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-12-01 07:45:01 -06:00
parent 19a496a8ff
commit 5724b78073
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
18 changed files with 3674 additions and 3037 deletions

View File

@ -76,7 +76,7 @@
"symfony/validator": "^5",
"voku/portable-utf8": "^5.4",
"wikimedia/composer-merge-plugin": "dev-feature/composer-v2",
"zircote/swagger-php": "3.0.4"
"zircote/swagger-php": "^3"
},
"require-dev": {
"codeception/codeception": "^4.0",
@ -86,7 +86,6 @@
"codeception/module-phpbrowser": "^1.0",
"codeception/module-rest": "^1.0",
"filp/whoops": "^2",
"flow/jsonpath": "^0.5",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-doctrine": "^0.12",
@ -94,6 +93,7 @@
"phpunit/phpunit": "^9.2",
"roave/security-advisories": "dev-master",
"slevomat/coding-standard": "^6.4",
"softcreatr/jsonpath": "^0.7.2",
"squizlabs/php_codesniffer": "^3.5",
"symfony/var-dumper": "^5.1"
},

5893
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -16,4 +16,4 @@ parameters:
- '#Cannot cast Symfony\\Component\\Validator\\ConstraintViolationListInterface to string.#'
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/extension.neon

View File

@ -149,7 +149,7 @@ class BackupCommand extends CommandAbstract
$fs = $storageLocation->getFilesystem();
$fs->putFromLocal($tmpPath, $path);
}
$io->newLine();
// Cleanup

View File

@ -96,7 +96,7 @@ abstract class AbstractLogViewerController
protected function getStationLogs(Entity\Station $station): array
{
$log_paths = [];
$stationConfigDir = $station->getRadioConfigDir();
switch ($station->getBackendType()) {

View File

@ -30,7 +30,7 @@ class SftpUsersController extends AbstractStationCrudController
if (!SftpGo::isSupportedForStation($station)) {
throw new StationUnsupportedException(__('This feature is not currently supported on this station.'));
}
$baseUrl = $request->getRouter()->getBaseUrl(false)
->withScheme('sftp')
->withPort(null);

View File

@ -4,6 +4,9 @@ namespace App\Entity\Api\Traits;
use OpenApi\Annotations as OA;
/**
* @OA\Schema(type="object")
*/
trait HasLinks
{
/**

View File

@ -13,12 +13,12 @@ final class Version20201010170333 extends AbstractMigration
{
return 'Add genre field as a first-class meta field for Station Media.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE station_media ADD genre varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE station_media DROP genre');

View File

@ -36,7 +36,7 @@ class StationPlaylistFolderRepository extends Repository
) {
/** @var Entity\StationPlaylist $playlist */
$playlist = $this->em->getReference(Entity\StationPlaylist::class, $playlistId);
$newRecord = new Entity\StationPlaylistFolder($station, $playlist, $path);
$this->em->persist($newRecord);
}

View File

@ -7,7 +7,7 @@ use Exception;
use OpenApi\Annotations as OA;
/**
* @OA\Schema(type="object", schema="Trait_UniqueId")
* @OA\Schema(type="object")
*/
trait UniqueId
{

View File

@ -17,7 +17,7 @@ class GetNotifications extends Event
$this->request = $request;
$this->notifications = [];
}
public function getRequest(): ServerRequest
{
return $this->request;

View File

@ -143,9 +143,13 @@ class Filesystem extends LeagueFilesystem implements FilesystemInterface
$iterator = new FilesystemIterator($this, $path, $iteratorOptions);
$options = Options::fromArray($iteratorOptions);
/** @phpstan-ignore-next-line */
if ($options->{Options::OPTION_IS_RECURSIVE}) {
$iterator = new RecursiveFilesystemIteratorIterator($iterator);
}
/** @phpstan-ignore-next-line */
if ($options->{Options::OPTION_FILTER} !== null) {
$iterator = new FilesystemFilterIterator($iterator, $options->{Options::OPTION_FILTER});
}

View File

@ -66,7 +66,7 @@ class StationFilesystemGroup extends MountManager implements FilesystemInterface
if ($this->getTimestamp($to) >= $this->getTimestamp($from)) {
$tempFullPath = $this->getLocalPath($to);
touch($tempFullPath);
return $to;
}

View File

@ -124,7 +124,7 @@ class RunAutomatedAssignmentTask extends AbstractTask
// Place all songs with 0 plays back in their original playlists.
foreach ($mediaReport as $song_id => $media) {
if ($media['num_plays'] === 0 && isset($original_playlists[$song_id])) {
if ($media['num_plays'] === 0) {
unset($mediaToUpdate[$media['id']], $mediaReport[$song_id]);
}
}

View File

@ -1,4 +1,4 @@
<?php //[STAMP] d574e046fe560a4983b9e1064d495868
<?php //[STAMP] 01d26489a71b65ea4dabb9ecd8a0f95b
namespace _generated;
// This class was automatically generated by build task
@ -32,7 +32,7 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Sets HTTP header valid for all next requests. Use `deleteHeader` to unset it
* Sets a HTTP header to be used for all subsequent requests. Use [`deleteHeader`](#deleteHeader) to unset it.
*
* ```php
* <?php
@ -55,17 +55,17 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes the header with the passed name. Subsequent requests
* will not have the deleted header in its request.
* Deletes a HTTP header (that was originally added by [haveHttpHeader()](#haveHttpHeader)),
* so that subsequent requests will not send it anymore.
*
* Example:
* ```php
* <?php
* $I->haveHttpHeader('X-Requested-With', 'Codeception');
* $I->sendGET('test-headers.php');
* $I->sendGet('test-headers.php');
* // ...
* $I->deleteHeader('X-Requested-With');
* $I->sendPOST('some-other-page.php');
* $I->sendPost('some-other-page.php');
* ?>
* ```
*
@ -134,7 +134,7 @@ trait FunctionalTesterActions
* @param $context
* @see \Codeception\Lib\InnerBrowser::click()
*/
public function click($link, $context = null) {
public function click($link, $context = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args()));
}
@ -173,7 +173,7 @@ trait FunctionalTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::see()
*/
public function see($text, $selector = null) {
public function see($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
}
/**
@ -211,7 +211,7 @@ trait FunctionalTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::see()
*/
public function canSee($text, $selector = null) {
public function canSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
}
@ -248,7 +248,7 @@ trait FunctionalTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::dontSee()
*/
public function dontSee($text, $selector = null) {
public function dontSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args()));
}
/**
@ -284,7 +284,7 @@ trait FunctionalTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::dontSee()
*/
public function cantSee($text, $selector = null) {
public function cantSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
}
@ -380,7 +380,7 @@ trait FunctionalTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::seeLink()
*/
public function seeLink($text, $url = null) {
public function seeLink($text, $url = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
}
/**
@ -401,7 +401,7 @@ trait FunctionalTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::seeLink()
*/
public function canSeeLink($text, $url = null) {
public function canSeeLink($text, $url = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
}
@ -423,7 +423,7 @@ trait FunctionalTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
*/
public function dontSeeLink($text, $url = null) {
public function dontSeeLink($text, $url = "") {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args()));
}
/**
@ -444,7 +444,7 @@ trait FunctionalTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
*/
public function cantSeeLink($text, $url = null) {
public function cantSeeLink($text, $url = "") {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
}
@ -707,7 +707,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
*/
public function grabFromCurrentUrl($uri = null) {
public function grabFromCurrentUrl($uri = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
}
@ -1302,7 +1302,7 @@ trait FunctionalTesterActions
* @param $button
* @see \Codeception\Lib\InnerBrowser::submitForm()
*/
public function submitForm($selector, $params, $button = null) {
public function submitForm($selector, $params, $button = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
}
@ -1429,16 +1429,14 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends a GET ajax request with specified params.
*
* See ->sendAjaxPostRequest for examples.
* Sends an ajax GET request with the passed parameters.
* See `sendAjaxPostRequest()`
*
* @param $uri
* @param $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
*/
public function sendAjaxGetRequest($uri, $params = null) {
public function sendAjaxGetRequest($uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
}
@ -1446,27 +1444,30 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends a POST ajax request with specified params.
* Additional params can be passed as array.
*
* Sends an ajax POST request with the passed parameters.
* The appropriate HTTP header is added automatically:
* `X-Requested-With: XMLHttpRequest`
* Example:
*
* Imagine that by clicking checkbox you trigger ajax request which updates user settings.
* We emulate that click by running this ajax request manually.
*
* ``` php
* <?php
* $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
* $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
*
* $I->sendAjaxPostRequest('/add-task', ['task' => 'lorem ipsum']);
* ```
* Some frameworks (e.g. Symfony) create field names in the form of an "array":
* `<input type="text" name="form[task]">`
* In this case you need to pass the fields like this:
* ``` php
* <?php
* $I->sendAjaxPostRequest('/add-task', ['form' => [
* 'task' => 'lorem ipsum',
* 'category' => 'miscellaneous',
* ]]);
* ```
*
* @param $uri
* @param $params
* @param string $uri
* @param array $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
*/
public function sendAjaxPostRequest($uri, $params = null) {
public function sendAjaxPostRequest($uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
}
@ -1474,17 +1475,12 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends an ajax request with specified method and params.
*
* Sends an ajax request, using the passed HTTP method.
* See `sendAjaxPostRequest()`
* Example:
*
* You need to perform an ajax request specifying the HTTP method.
*
* ``` php
* <?php
* $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
*
* $I->sendAjaxRequest('PUT', '/posts/7', ['title' => 'new title']);
* ```
*
* @param $method
@ -1492,7 +1488,7 @@ trait FunctionalTesterActions
* @param $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
*/
public function sendAjaxRequest($method, $uri, $params = null) {
public function sendAjaxRequest($method, $uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
}
@ -1514,7 +1510,7 @@ trait FunctionalTesterActions
* @param null $name
* @see \Codeception\Lib\InnerBrowser::makeHtmlSnapshot()
*/
public function makeHtmlSnapshot($name = null) {
public function makeHtmlSnapshot($name = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args()));
}
@ -1595,7 +1591,7 @@ trait FunctionalTesterActions
* @return string[]
* @see \Codeception\Lib\InnerBrowser::grabMultiple()
*/
public function grabMultiple($cssOrXpath, $attribute = null) {
public function grabMultiple($cssOrXpath, $attribute = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
}
@ -1632,7 +1628,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::setCookie()
*/
public function setCookie($name, $val, $params = null) {
public function setCookie($name, $val, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
}
@ -1642,6 +1638,7 @@ trait FunctionalTesterActions
*
* Grabs a cookie value.
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
* If the cookie is set by an ajax request (XMLHttpRequest), there might be some delay caused by the browser, so try `$I->wait(0.1)`.
*
* @param $cookie
*
@ -1649,7 +1646,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::grabCookie()
*/
public function grabCookie($cookie, $params = null) {
public function grabCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
}
@ -1686,7 +1683,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::seeCookie()
*/
public function seeCookie($cookie, $params = null) {
public function seeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
}
/**
@ -1707,7 +1704,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::seeCookie()
*/
public function canSeeCookie($cookie, $params = null) {
public function canSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
}
@ -1724,7 +1721,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
*/
public function dontSeeCookie($cookie, $params = null) {
public function dontSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args()));
}
/**
@ -1740,7 +1737,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
*/
public function cantSeeCookie($cookie, $params = null) {
public function cantSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
}
@ -1757,7 +1754,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::resetCookie()
*/
public function resetCookie($name, $params = null) {
public function resetCookie($name, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
}
@ -1785,7 +1782,7 @@ trait FunctionalTesterActions
* @return
* @see \Codeception\Lib\InnerBrowser::seeElement()
*/
public function seeElement($selector, $attributes = null) {
public function seeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
}
/**
@ -1812,7 +1809,7 @@ trait FunctionalTesterActions
* @return
* @see \Codeception\Lib\InnerBrowser::seeElement()
*/
public function canSeeElement($selector, $attributes = null) {
public function canSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
}
@ -1836,7 +1833,7 @@ trait FunctionalTesterActions
* @param array $attributes
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
*/
public function dontSeeElement($selector, $attributes = null) {
public function dontSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args()));
}
/**
@ -1859,7 +1856,7 @@ trait FunctionalTesterActions
* @param array $attributes
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
*/
public function cantSeeElement($selector, $attributes = null) {
public function cantSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
}
@ -2337,7 +2334,7 @@ trait FunctionalTesterActions
* @param int $numberOfSteps (default value 1)
* @see \Codeception\Lib\InnerBrowser::moveBack()
*/
public function moveBack($numberOfSteps = null) {
public function moveBack($numberOfSteps = 1) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
}
@ -2347,7 +2344,7 @@ trait FunctionalTesterActions
*
* Sets SERVER parameters valid for all next requests.
* this will remove old ones.
*
*
* ```php
* $I->setServerParameters([]);
* ```
@ -2362,7 +2359,7 @@ trait FunctionalTesterActions
* [!] Method is generated. Documentation taken from corresponding module.
*
* Sets SERVER parameter valid for all next requests.
*
*
* ```php
* $I->haveServerParameter('name', 'value');
* ```
@ -2434,10 +2431,10 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* This method is deprecated in favor of `haveInRepository()`. It's functionality is exactly the same.
* This method is deprecated in favor of `haveInRepository()`. Its functionality is exactly the same.
* @see \Codeception\Module\Doctrine2::persistEntity()
*/
public function persistEntity($obj, $values = null) {
public function persistEntity($obj, $values = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('persistEntity', func_get_args()));
}
@ -2455,7 +2452,7 @@ trait FunctionalTesterActions
* ``` php
* <?php
*
* $I->haveFakeRepository('Entity\User', array('findByUsername' => function($username) { return null; }));
* $I->haveFakeRepository(User::class, ['findByUsername' => function($username) { return null; }]);
*
* ```
*
@ -2466,7 +2463,7 @@ trait FunctionalTesterActions
* @param array $methods
* @see \Codeception\Module\Doctrine2::haveFakeRepository()
*/
public function haveFakeRepository($classname, $methods = null) {
public function haveFakeRepository($classname, $methods = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('haveFakeRepository', func_get_args()));
}
@ -2474,69 +2471,67 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Persists record into repository.
* Persists a record into the repository.
* This method creates an entity, and sets its properties directly (via reflection).
* Setters of entity won't be executed, but you can create almost any entity and save it to database.
* Setters of the entity won't be executed, but you can create almost any entity and save it to the database.
* If the entity has a constructor, for optional parameters the default value will be used and for non-optional parameters the given fields (with a matching name) will be passed when calling the constructor before the properties get set directly (via reflection).
*
* Returns primary key of newly created entity. Primary key value is extracted using Reflection API.
* If primary key is composite, array of values is returned.
* Returns the primary key of the newly created entity. The primary key value is extracted using Reflection API.
* If the primary key is composite, an array of values is returned.
*
* ```php
* $I->haveInRepository('Entity\User', array('name' => 'davert'));
* $I->haveInRepository(User::class, ['name' => 'davert']);
* ```
*
* This method also accepts instances as first argument, which is useful when entity constructor
* This method also accepts instances as first argument, which is useful when the entity constructor
* has some arguments:
*
* ```php
* $I->haveInRepository(new User($arg), array('name' => 'davert'));
* $I->haveInRepository(new User($arg), ['name' => 'davert']);
* ```
*
* Alternatively, constructor arguments can be passed by name. Given User constructor signature is `__constructor($arg)`, the example above could be rewritten like this:
*
* ```php
* $I->haveInRepository('Entity\User', array('arg' => $arg, 'name' => 'davert'));
* $I->haveInRepository(User::class, ['arg' => $arg, 'name' => 'davert']);
* ```
*
* If entity has relations, they can be populated too. In case of OneToMany the following format
* ie expected:
* If the entity has relations, they can be populated too. In case of
* [OneToMany](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-many-bidirectional)
* the following format is expected:
*
* ```php
* $I->haveInRepository('Entity\User', array(
* $I->haveInRepository(User::class, [
* 'name' => 'davert',
* 'posts' => array(
* array(
* 'title' => 'Post 1',
* ),
* array(
* 'title' => 'Post 2',
* ),
* ),
* ));
* 'posts' => [
* ['title' => 'Post 1'],
* ['title' => 'Post 2'],
* ],
* ]);
* ```
*
* For ManyToOne format is slightly different:
* For [ManyToOne](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#many-to-one-unidirectional)
* the format is slightly different:
*
* ```php
* $I->haveInRepository('Entity\User', array(
* $I->haveInRepository(User::class, [
* 'name' => 'davert',
* 'post' => array(
* 'post' => [
* 'title' => 'Post 1',
* ),
* ));
* ],
* ]);
* ```
*
* This works recursively, so you can create deep structures in a single call.
*
* Note that both `$em->persist(...)`, $em->refresh(...), and `$em->flush()` are called every time.
* Note that `$em->persist()`, `$em->refresh()`, and `$em->flush()` are called every time.
*
* @param string|object $classNameOrInstance
* @param array $data
* @return mixed
* @see \Codeception\Module\Doctrine2::haveInRepository()
*/
public function haveInRepository($classNameOrInstance, $data = null) {
public function haveInRepository($classNameOrInstance, $data = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('haveInRepository', func_get_args()));
}
@ -2562,7 +2557,7 @@ trait FunctionalTesterActions
* $I->loadFixtures(AppFixtures::class, false);
* ```
*
* Note: this method requires `doctrine/data-fixtures` package to be installed.
* This method requires [`doctrine/data-fixtures`](https://github.com/doctrine/data-fixtures) to be installed.
*
* @param string|string[]|object[] $fixtures
* @param bool $append
@ -2570,7 +2565,7 @@ trait FunctionalTesterActions
* @throws ModuleRequireException
* @see \Codeception\Module\Doctrine2::loadFixtures()
*/
public function loadFixtures($fixtures, $append = null) {
public function loadFixtures($fixtures, $append = true) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('loadFixtures', func_get_args()));
}
@ -2585,9 +2580,9 @@ trait FunctionalTesterActions
*
* ``` php
* <?php
* $I->seeInRepository('AppBundle:User', array('name' => 'davert'));
* $I->seeInRepository('User', array('name' => 'davert', 'Company' => array('name' => 'Codegyre')));
* $I->seeInRepository('Client', array('User' => array('Company' => array('name' => 'Codegyre')));
* $I->seeInRepository(User::class, ['name' => 'davert']);
* $I->seeInRepository(User::class, ['name' => 'davert', 'Company' => ['name' => 'Codegyre']]);
* $I->seeInRepository(Client::class, ['User' => ['Company' => ['name' => 'Codegyre']]]);
* ?>
* ```
*
@ -2597,7 +2592,7 @@ trait FunctionalTesterActions
* @param array $params
* @see \Codeception\Module\Doctrine2::seeInRepository()
*/
public function seeInRepository($entity, $params = null) {
public function seeInRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInRepository', func_get_args()));
}
/**
@ -2611,9 +2606,9 @@ trait FunctionalTesterActions
*
* ``` php
* <?php
* $I->seeInRepository('AppBundle:User', array('name' => 'davert'));
* $I->seeInRepository('User', array('name' => 'davert', 'Company' => array('name' => 'Codegyre')));
* $I->seeInRepository('Client', array('User' => array('Company' => array('name' => 'Codegyre')));
* $I->seeInRepository(User::class, ['name' => 'davert']);
* $I->seeInRepository(User::class, ['name' => 'davert', 'Company' => ['name' => 'Codegyre']]);
* $I->seeInRepository(Client::class, ['User' => ['Company' => ['name' => 'Codegyre']]]);
* ?>
* ```
*
@ -2623,7 +2618,7 @@ trait FunctionalTesterActions
* @param array $params
* @see \Codeception\Module\Doctrine2::seeInRepository()
*/
public function canSeeInRepository($entity, $params = null) {
public function canSeeInRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInRepository', func_get_args()));
}
@ -2637,7 +2632,7 @@ trait FunctionalTesterActions
* @param array $params
* @see \Codeception\Module\Doctrine2::dontSeeInRepository()
*/
public function dontSeeInRepository($entity, $params = null) {
public function dontSeeInRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeInRepository', func_get_args()));
}
/**
@ -2650,7 +2645,7 @@ trait FunctionalTesterActions
* @param array $params
* @see \Codeception\Module\Doctrine2::dontSeeInRepository()
*/
public function cantSeeInRepository($entity, $params = null) {
public function cantSeeInRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInRepository', func_get_args()));
}
@ -2666,7 +2661,7 @@ trait FunctionalTesterActions
*
* ``` php
* <?php
* $email = $I->grabFromRepository('User', 'email', array('name' => 'davert'));
* $email = $I->grabFromRepository(User::class, 'email', ['name' => 'davert']);
* ?>
* ```
*
@ -2677,7 +2672,7 @@ trait FunctionalTesterActions
* @return mixed
* @see \Codeception\Module\Doctrine2::grabFromRepository()
*/
public function grabFromRepository($entity, $field, $params = null) {
public function grabFromRepository($entity, $field, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromRepository', func_get_args()));
}
@ -2693,17 +2688,17 @@ trait FunctionalTesterActions
*
* ``` php
* <?php
* $users = $I->grabEntitiesFromRepository('AppBundle:User', array('name' => 'davert'));
* $users = $I->grabEntitiesFromRepository(User::class, ['name' => 'davert']);
* ?>
* ```
*
* @version 1.1
* @param $entity
* @param array $params. For `IS NULL`, use `array('field'=>null)`
* @param array $params. For `IS NULL`, use `['field' => null]`
* @return array
* @see \Codeception\Module\Doctrine2::grabEntitiesFromRepository()
*/
public function grabEntitiesFromRepository($entity, $params = null) {
public function grabEntitiesFromRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabEntitiesFromRepository', func_get_args()));
}
@ -2719,17 +2714,17 @@ trait FunctionalTesterActions
*
* ``` php
* <?php
* $user = $I->grabEntityFromRepository('User', array('id' => '1234'));
* $user = $I->grabEntityFromRepository(User::class, ['id' => '1234']);
* ?>
* ```
*
* @version 1.1
* @param $entity
* @param array $params. For `IS NULL`, use `array('field'=>null)`
* @param array $params. For `IS NULL`, use `['field' => null]`
* @return object
* @see \Codeception\Module\Doctrine2::grabEntityFromRepository()
*/
public function grabEntityFromRepository($entity, $params = null) {
public function grabEntityFromRepository($entity, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabEntityFromRepository', func_get_args()));
}
@ -2746,7 +2741,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::seeHttpHeader()
*/
public function seeHttpHeader($name, $value = null) {
public function seeHttpHeader($name, $value = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeHttpHeader', func_get_args()));
}
/**
@ -2762,7 +2757,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::seeHttpHeader()
*/
public function canSeeHttpHeader($name, $value = null) {
public function canSeeHttpHeader($name, $value = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeHttpHeader', func_get_args()));
}
@ -2779,7 +2774,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::dontSeeHttpHeader()
*/
public function dontSeeHttpHeader($name, $value = null) {
public function dontSeeHttpHeader($name, $value = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeHttpHeader', func_get_args()));
}
/**
@ -2795,7 +2790,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::dontSeeHttpHeader()
*/
public function cantSeeHttpHeader($name, $value = null) {
public function cantSeeHttpHeader($name, $value = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeHttpHeader', func_get_args()));
}
@ -2858,7 +2853,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::grabHttpHeader()
*/
public function grabHttpHeader($name, $first = null) {
public function grabHttpHeader($name, $first = true) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabHttpHeader', func_get_args()));
}
@ -2947,7 +2942,7 @@ trait FunctionalTesterActions
* @throws ModuleException
* @see \Codeception\Module\REST::amAWSAuthenticated()
*/
public function amAWSAuthenticated($additionalAWSConfig = null) {
public function amAWSAuthenticated($additionalAWSConfig = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Condition('amAWSAuthenticated', func_get_args()));
}
@ -2961,11 +2956,11 @@ trait FunctionalTesterActions
* ```php
* <?php
* //simple POST call
* $I->sendPOST('/message', ['subject' => 'Read this!', 'to' => 'johndoe@example.com']);
* $I->sendPost('/message', ['subject' => 'Read this!', 'to' => 'johndoe@example.com']);
* //simple upload method
* $I->sendPOST('/message/24', ['inline' => 0], ['attachmentFile' => codecept_data_dir('sample_file.pdf')]);
* $I->sendPost('/message/24', ['inline' => 0], ['attachmentFile' => codecept_data_dir('sample_file.pdf')]);
* //uploading a file with a custom name and mime-type. This is also useful to simulate upload errors.
* $I->sendPOST('/message/24', ['inline' => 0], [
* $I->sendPost('/message/24', ['inline' => 0], [
* 'attachmentFile' => [
* 'name' => 'document.pdf',
* 'type' => 'application/pdf',
@ -2974,6 +2969,12 @@ trait FunctionalTesterActions
* 'tmp_name' => codecept_data_dir('sample_file.pdf')
* ]
* ]);
* // If your field names contain square brackets (e.g. `<input type="text" name="form[task]">`),
* // PHP parses them into an array. In this case you need to pass the fields like this:
* $I->sendPost('/add-task', ['form' => [
* 'task' => 'lorem ipsum',
* 'category' => 'miscellaneous',
* ]]);
* ```
*
* @param $url
@ -2986,10 +2987,10 @@ trait FunctionalTesterActions
* @see codecept_data_dir()
* @part json
* @part xml
* @see \Codeception\Module\REST::sendPOST()
* @see \Codeception\Module\REST::sendPost()
*/
public function sendPOST($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPOST', func_get_args()));
public function sendPost($url, $params = [], $files = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPost', func_get_args()));
}
@ -3002,10 +3003,10 @@ trait FunctionalTesterActions
* @param array $params
* @part json
* @part xml
* @see \Codeception\Module\REST::sendHEAD()
* @see \Codeception\Module\REST::sendHead()
*/
public function sendHEAD($url, $params = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendHEAD', func_get_args()));
public function sendHead($url, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendHead', func_get_args()));
}
@ -3018,10 +3019,10 @@ trait FunctionalTesterActions
* @param array $params
* @part json
* @part xml
* @see \Codeception\Module\REST::sendOPTIONS()
* @see \Codeception\Module\REST::sendOptions()
*/
public function sendOPTIONS($url, $params = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendOPTIONS', func_get_args()));
public function sendOptions($url, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendOptions', func_get_args()));
}
@ -3034,10 +3035,10 @@ trait FunctionalTesterActions
* @param array $params
* @part json
* @part xml
* @see \Codeception\Module\REST::sendGET()
* @see \Codeception\Module\REST::sendGet()
*/
public function sendGET($url, $params = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendGET', func_get_args()));
public function sendGet($url, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendGet', func_get_args()));
}
@ -3051,10 +3052,10 @@ trait FunctionalTesterActions
* @param array $files
* @part json
* @part xml
* @see \Codeception\Module\REST::sendPUT()
* @see \Codeception\Module\REST::sendPut()
*/
public function sendPUT($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPUT', func_get_args()));
public function sendPut($url, $params = [], $files = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPut', func_get_args()));
}
@ -3068,10 +3069,10 @@ trait FunctionalTesterActions
* @param array $files
* @part json
* @part xml
* @see \Codeception\Module\REST::sendPATCH()
* @see \Codeception\Module\REST::sendPatch()
*/
public function sendPATCH($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPATCH', func_get_args()));
public function sendPatch($url, $params = [], $files = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendPatch', func_get_args()));
}
@ -3085,10 +3086,10 @@ trait FunctionalTesterActions
* @param array $files
* @part json
* @part xml
* @see \Codeception\Module\REST::sendDELETE()
* @see \Codeception\Module\REST::sendDelete()
*/
public function sendDELETE($url, $params = null, $files = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendDELETE', func_get_args()));
public function sendDelete($url, $params = [], $files = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendDelete', func_get_args()));
}
@ -3105,10 +3106,10 @@ trait FunctionalTesterActions
* @author samva.ua@gmail.com
* @part json
* @part xml
* @see \Codeception\Module\REST::sendLINK()
* @see \Codeception\Module\REST::sendLink()
*/
public function sendLINK($url, $linkEntries) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendLINK', func_get_args()));
public function sendLink($url, $linkEntries) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendLink', func_get_args()));
}
@ -3123,10 +3124,10 @@ trait FunctionalTesterActions
* @author samva.ua@gmail.com
* @part json
* @part xml
* @see \Codeception\Module\REST::sendUNLINK()
* @see \Codeception\Module\REST::sendUnlink()
*/
public function sendUNLINK($url, $linkEntries) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendUNLINK', func_get_args()));
public function sendUnlink($url, $linkEntries) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendUnlink', func_get_args()));
}
@ -3242,7 +3243,7 @@ trait FunctionalTesterActions
* @part json
* @see \Codeception\Module\REST::seeResponseContainsJson()
*/
public function seeResponseContainsJson($json = null) {
public function seeResponseContainsJson($json = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseContainsJson', func_get_args()));
}
/**
@ -3273,7 +3274,7 @@ trait FunctionalTesterActions
* @part json
* @see \Codeception\Module\REST::seeResponseContainsJson()
*/
public function canSeeResponseContainsJson($json = null) {
public function canSeeResponseContainsJson($json = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseContainsJson', func_get_args()));
}
@ -3392,7 +3393,7 @@ trait FunctionalTesterActions
* ``` php
* <?php
* $user_id = $I->grabResponse();
* $I->sendPUT('/user', array('id' => $user_id, 'name' => 'davert'));
* $I->sendPut('/user', array('id' => $user_id, 'name' => 'davert'));
* ?>
* ```
*
@ -3423,7 +3424,7 @@ trait FunctionalTesterActions
* <?php
* // match the first `user.id` in json
* $firstUserId = $I->grabDataFromResponseByJsonPath('$..users[0].id');
* $I->sendPUT('/user', array('id' => $firstUserId[0], 'name' => 'davert'));
* $I->sendPut('/user', array('id' => $firstUserId[0], 'name' => 'davert'));
* ?>
* ```
*
@ -3704,7 +3705,7 @@ trait FunctionalTesterActions
* @param array $json
* @see \Codeception\Module\REST::dontSeeResponseContainsJson()
*/
public function dontSeeResponseContainsJson($json = null) {
public function dontSeeResponseContainsJson($json = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseContainsJson', func_get_args()));
}
/**
@ -3717,7 +3718,7 @@ trait FunctionalTesterActions
* @param array $json
* @see \Codeception\Module\REST::dontSeeResponseContainsJson()
*/
public function cantSeeResponseContainsJson($json = null) {
public function cantSeeResponseContainsJson($json = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseContainsJson', func_get_args()));
}
@ -3808,7 +3809,7 @@ trait FunctionalTesterActions
* @version 2.1.3
* @see \Codeception\Module\REST::seeResponseMatchesJsonType()
*/
public function seeResponseMatchesJsonType($jsonType, $jsonPath = null) {
public function seeResponseMatchesJsonType($jsonType, $jsonPath = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseMatchesJsonType', func_get_args()));
}
/**
@ -3898,7 +3899,7 @@ trait FunctionalTesterActions
* @version 2.1.3
* @see \Codeception\Module\REST::seeResponseMatchesJsonType()
*/
public function canSeeResponseMatchesJsonType($jsonType, $jsonPath = null) {
public function canSeeResponseMatchesJsonType($jsonType, $jsonPath = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseMatchesJsonType', func_get_args()));
}
@ -3915,7 +3916,7 @@ trait FunctionalTesterActions
* @version 2.1.3
* @see \Codeception\Module\REST::dontSeeResponseMatchesJsonType()
*/
public function dontSeeResponseMatchesJsonType($jsonType, $jsonPath = null) {
public function dontSeeResponseMatchesJsonType($jsonType, $jsonPath = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeResponseMatchesJsonType', func_get_args()));
}
/**
@ -3931,7 +3932,7 @@ trait FunctionalTesterActions
* @version 2.1.3
* @see \Codeception\Module\REST::dontSeeResponseMatchesJsonType()
*/
public function cantSeeResponseMatchesJsonType($jsonType, $jsonPath = null) {
public function cantSeeResponseMatchesJsonType($jsonType, $jsonPath = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseMatchesJsonType', func_get_args()));
}
@ -4277,7 +4278,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::seeBinaryResponseEquals()
*/
public function seeBinaryResponseEquals($hash, $algo = null) {
public function seeBinaryResponseEquals($hash, $algo = "md5") {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeBinaryResponseEquals', func_get_args()));
}
/**
@ -4319,7 +4320,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::seeBinaryResponseEquals()
*/
public function canSeeBinaryResponseEquals($hash, $algo = null) {
public function canSeeBinaryResponseEquals($hash, $algo = "md5") {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeBinaryResponseEquals', func_get_args()));
}
@ -4342,7 +4343,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::dontSeeBinaryResponseEquals()
*/
public function dontSeeBinaryResponseEquals($hash, $algo = null) {
public function dontSeeBinaryResponseEquals($hash, $algo = "md5") {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeBinaryResponseEquals', func_get_args()));
}
/**
@ -4364,7 +4365,7 @@ trait FunctionalTesterActions
* @part xml
* @see \Codeception\Module\REST::dontSeeBinaryResponseEquals()
*/
public function cantSeeBinaryResponseEquals($hash, $algo = null) {
public function cantSeeBinaryResponseEquals($hash, $algo = "md5") {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeBinaryResponseEquals', func_get_args()));
}
@ -4411,7 +4412,7 @@ trait FunctionalTesterActions
* [!] Method is generated. Documentation taken from corresponding module.
*
* Executes a shell command.
* Fails If exit code is > 0. You can disable this by setting second parameter to false
* Fails if exit code is > 0. You can disable this by passing `false` as second argument
*
* ```php
* <?php
@ -4425,7 +4426,7 @@ trait FunctionalTesterActions
* @param bool $failNonZero
* @see \Codeception\Module\Cli::runShellCommand()
*/
public function runShellCommand($command, $failNonZero = null) {
public function runShellCommand($command, $failNonZero = true) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('runShellCommand', func_get_args()));
}
@ -4506,7 +4507,18 @@ trait FunctionalTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks result code
* Returns the output from latest command
* @see \Codeception\Module\Cli::grabShellOutput()
*/
public function grabShellOutput() {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabShellOutput', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks result code. To verify a result code > 0, you need to pass `false` as second argument to `runShellCommand()`
*
* ```php
* <?php
@ -4523,7 +4535,7 @@ trait FunctionalTesterActions
* [!] Method is generated. Documentation taken from corresponding module.
*
* [!] Conditional Assertion: Test won't be stopped on fail
* Checks result code
* Checks result code. To verify a result code > 0, you need to pass `false` as second argument to `runShellCommand()`
*
* ```php
* <?php

View File

@ -1,4 +1,4 @@
<?php //[STAMP] 70ce00c011623f9bcc38ddda9f3b8381
<?php //[STAMP] 39f1e9ae714770bed9e356e659952e51
namespace _generated;
// This class was automatically generated by build task
@ -142,7 +142,7 @@ trait UnitTesterActions
* @param $context
* @see \Codeception\Lib\InnerBrowser::click()
*/
public function click($link, $context = null) {
public function click($link, $context = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args()));
}
@ -181,7 +181,7 @@ trait UnitTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::see()
*/
public function see($text, $selector = null) {
public function see($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
}
/**
@ -219,7 +219,7 @@ trait UnitTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::see()
*/
public function canSee($text, $selector = null) {
public function canSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
}
@ -256,7 +256,7 @@ trait UnitTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::dontSee()
*/
public function dontSee($text, $selector = null) {
public function dontSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSee', func_get_args()));
}
/**
@ -292,7 +292,7 @@ trait UnitTesterActions
* @param array|string $selector optional
* @see \Codeception\Lib\InnerBrowser::dontSee()
*/
public function cantSee($text, $selector = null) {
public function cantSee($text, $selector = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
}
@ -388,7 +388,7 @@ trait UnitTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::seeLink()
*/
public function seeLink($text, $url = null) {
public function seeLink($text, $url = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
}
/**
@ -409,7 +409,7 @@ trait UnitTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::seeLink()
*/
public function canSeeLink($text, $url = null) {
public function canSeeLink($text, $url = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
}
@ -431,7 +431,7 @@ trait UnitTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
*/
public function dontSeeLink($text, $url = null) {
public function dontSeeLink($text, $url = "") {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeLink', func_get_args()));
}
/**
@ -452,7 +452,7 @@ trait UnitTesterActions
* @param string $url optional
* @see \Codeception\Lib\InnerBrowser::dontSeeLink()
*/
public function cantSeeLink($text, $url = null) {
public function cantSeeLink($text, $url = "") {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
}
@ -715,7 +715,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
*/
public function grabFromCurrentUrl($uri = null) {
public function grabFromCurrentUrl($uri = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
}
@ -1310,7 +1310,7 @@ trait UnitTesterActions
* @param $button
* @see \Codeception\Lib\InnerBrowser::submitForm()
*/
public function submitForm($selector, $params, $button = null) {
public function submitForm($selector, $params, $button = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
}
@ -1437,16 +1437,14 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends a GET ajax request with specified params.
*
* See ->sendAjaxPostRequest for examples.
* Sends an ajax GET request with the passed parameters.
* See `sendAjaxPostRequest()`
*
* @param $uri
* @param $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
*/
public function sendAjaxGetRequest($uri, $params = null) {
public function sendAjaxGetRequest($uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
}
@ -1454,27 +1452,30 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends a POST ajax request with specified params.
* Additional params can be passed as array.
*
* Sends an ajax POST request with the passed parameters.
* The appropriate HTTP header is added automatically:
* `X-Requested-With: XMLHttpRequest`
* Example:
*
* Imagine that by clicking checkbox you trigger ajax request which updates user settings.
* We emulate that click by running this ajax request manually.
*
* ``` php
* <?php
* $I->sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
* $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
*
* $I->sendAjaxPostRequest('/add-task', ['task' => 'lorem ipsum']);
* ```
* Some frameworks (e.g. Symfony) create field names in the form of an "array":
* `<input type="text" name="form[task]">`
* In this case you need to pass the fields like this:
* ``` php
* <?php
* $I->sendAjaxPostRequest('/add-task', ['form' => [
* 'task' => 'lorem ipsum',
* 'category' => 'miscellaneous',
* ]]);
* ```
*
* @param $uri
* @param $params
* @param string $uri
* @param array $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
*/
public function sendAjaxPostRequest($uri, $params = null) {
public function sendAjaxPostRequest($uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
}
@ -1482,17 +1483,12 @@ trait UnitTesterActions
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* If your page triggers an ajax request, you can perform it manually.
* This action sends an ajax request with specified method and params.
*
* Sends an ajax request, using the passed HTTP method.
* See `sendAjaxPostRequest()`
* Example:
*
* You need to perform an ajax request specifying the HTTP method.
*
* ``` php
* <?php
* $I->sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
*
* $I->sendAjaxRequest('PUT', '/posts/7', ['title' => 'new title']);
* ```
*
* @param $method
@ -1500,7 +1496,7 @@ trait UnitTesterActions
* @param $params
* @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
*/
public function sendAjaxRequest($method, $uri, $params = null) {
public function sendAjaxRequest($method, $uri, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
}
@ -1522,7 +1518,7 @@ trait UnitTesterActions
* @param null $name
* @see \Codeception\Lib\InnerBrowser::makeHtmlSnapshot()
*/
public function makeHtmlSnapshot($name = null) {
public function makeHtmlSnapshot($name = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('makeHtmlSnapshot', func_get_args()));
}
@ -1603,7 +1599,7 @@ trait UnitTesterActions
* @return string[]
* @see \Codeception\Lib\InnerBrowser::grabMultiple()
*/
public function grabMultiple($cssOrXpath, $attribute = null) {
public function grabMultiple($cssOrXpath, $attribute = NULL) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args()));
}
@ -1640,7 +1636,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::setCookie()
*/
public function setCookie($name, $val, $params = null) {
public function setCookie($name, $val, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
}
@ -1650,6 +1646,7 @@ trait UnitTesterActions
*
* Grabs a cookie value.
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
* If the cookie is set by an ajax request (XMLHttpRequest), there might be some delay caused by the browser, so try `$I->wait(0.1)`.
*
* @param $cookie
*
@ -1657,7 +1654,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::grabCookie()
*/
public function grabCookie($cookie, $params = null) {
public function grabCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
}
@ -1694,7 +1691,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::seeCookie()
*/
public function seeCookie($cookie, $params = null) {
public function seeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
}
/**
@ -1715,7 +1712,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::seeCookie()
*/
public function canSeeCookie($cookie, $params = null) {
public function canSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
}
@ -1732,7 +1729,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
*/
public function dontSeeCookie($cookie, $params = null) {
public function dontSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeCookie', func_get_args()));
}
/**
@ -1748,7 +1745,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
*/
public function cantSeeCookie($cookie, $params = null) {
public function cantSeeCookie($cookie, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
}
@ -1765,7 +1762,7 @@ trait UnitTesterActions
* @return mixed
* @see \Codeception\Lib\InnerBrowser::resetCookie()
*/
public function resetCookie($name, $params = null) {
public function resetCookie($name, $params = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
}
@ -1793,7 +1790,7 @@ trait UnitTesterActions
* @return
* @see \Codeception\Lib\InnerBrowser::seeElement()
*/
public function seeElement($selector, $attributes = null) {
public function seeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
}
/**
@ -1820,7 +1817,7 @@ trait UnitTesterActions
* @return
* @see \Codeception\Lib\InnerBrowser::seeElement()
*/
public function canSeeElement($selector, $attributes = null) {
public function canSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
}
@ -1844,7 +1841,7 @@ trait UnitTesterActions
* @param array $attributes
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
*/
public function dontSeeElement($selector, $attributes = null) {
public function dontSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('dontSeeElement', func_get_args()));
}
/**
@ -1867,7 +1864,7 @@ trait UnitTesterActions
* @param array $attributes
* @see \Codeception\Lib\InnerBrowser::dontSeeElement()
*/
public function cantSeeElement($selector, $attributes = null) {
public function cantSeeElement($selector, $attributes = []) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
}
@ -2311,7 +2308,7 @@ trait UnitTesterActions
* @param int $numberOfSteps (default value 1)
* @see \Codeception\Lib\InnerBrowser::moveBack()
*/
public function moveBack($numberOfSteps = null) {
public function moveBack($numberOfSteps = 1) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('moveBack', func_get_args()));
}

View File

@ -66,6 +66,7 @@ use OpenApi\Annotations as OA;
* @OA\Tag(name="Administration: Roles")
* @OA\Tag(name="Administration: Settings")
* @OA\Tag(name="Administration: Stations")
* @OA\Tag(name="Administration: Storage Locations")
*
* @OA\Tag(name="Miscellaneous")
*

View File

@ -2030,64 +2030,68 @@ components:
nullable: true
type: object
Api_Admin_StorageLocation:
properties:
id:
type: integer
example: 1
type:
type: string
example: station_media
adapter:
type: string
example: local
path:
type: string
example: /var/azuracast/stations/azuratest_radio/media
nullable: true
s3CredentialKey:
type: string
example: your-key-here
nullable: true
s3CredentialSecret:
type: string
example: your-secret-here
nullable: true
s3Region:
type: string
example: your-region
nullable: true
s3Version:
type: string
example: latest
nullable: true
s3Bucket:
type: string
example: your-bucket-name
nullable: true
s3Endpoint:
type: string
example: 'https://your-region.digitaloceanspaces.com'
nullable: true
storageQuota:
type: string
example: '50 GB'
nullable: true
storageUsed:
type: string
example: '1 GB'
nullable: true
uri:
description: 'The URI associated with the storage location.'
type: string
example: /var/azuracast/www
stations:
description: 'The stations using this storage location, if any.'
type: array
items:
type: string
example: 'AzuraTest Radio'
nullable: true
type: object
allOf:
-
$ref: '#/components/schemas/HasLinks'
-
properties:
id:
type: integer
example: 1
type:
type: string
example: station_media
adapter:
type: string
example: local
path:
type: string
example: /var/azuracast/stations/azuratest_radio/media
nullable: true
s3CredentialKey:
type: string
example: your-key-here
nullable: true
s3CredentialSecret:
type: string
example: your-secret-here
nullable: true
s3Region:
type: string
example: your-region
nullable: true
s3Version:
type: string
example: latest
nullable: true
s3Bucket:
type: string
example: your-bucket-name
nullable: true
s3Endpoint:
type: string
example: 'https://your-region.digitaloceanspaces.com'
nullable: true
storageQuota:
type: string
example: '50 GB'
nullable: true
storageUsed:
type: string
example: '1 GB'
nullable: true
uri:
description: 'The URI associated with the storage location.'
type: string
example: /var/azuracast/www
stations:
description: 'The stations using this storage location, if any.'
type: array
items:
type: string
example: 'AzuraTest Radio'
nullable: true
Api_DetailedSongHistory:
allOf:
-
@ -2148,7 +2152,7 @@ components:
connected_on:
description: 'UNIX timestamp that the user first connected.'
type: integer
example: 1606584191
example: 1606746142
connected_time:
description: 'Number of seconds that the user has been connected.'
type: integer
@ -2294,7 +2298,7 @@ components:
played_at:
description: 'UNIX timestamp when playback started.'
type: integer
example: 1606584191
example: 1606746142
duration:
description: 'Duration of the song in seconds'
type: integer
@ -2392,7 +2396,7 @@ components:
cued_at:
description: 'UNIX timestamp when playback is expected to start.'
type: integer
example: 1606584191
example: 1606746142
duration:
description: 'Duration of the song in seconds'
type: integer
@ -2410,15 +2414,12 @@ components:
type: object
Api_StationQueueDetailed:
allOf:
-
$ref: '#/components/schemas/HasLinks'
-
$ref: '#/components/schemas/Api_StationQueue'
-
properties:
links:
type: array
items:
type: string
example: 'http://localhost/api/stations/1/queue/1'
autodj_custom_uri:
description: 'Custom AutoDJ playback URI, if it exists.'
type: string
@ -2484,7 +2485,7 @@ components:
start_timestamp:
description: 'The start time of the schedule entry, in UNIX format.'
type: integer
example: 1606584191
example: 1606746142
start:
description: 'The start time of the schedule entry, in ISO 8601 format.'
type: string
@ -2492,7 +2493,7 @@ components:
end_timestamp:
description: 'The end time of the schedule entry, in UNIX format.'
type: integer
example: 1606584191
example: 1606746142
end:
description: 'The start time of the schedule entry, in ISO 8601 format.'
type: string
@ -2532,7 +2533,7 @@ components:
timestamp:
description: 'The current UNIX timestamp'
type: integer
example: 1606584191
example: 1606746142
type: object
Api_Time:
properties:
@ -2553,6 +2554,14 @@ components:
type: string
example: '2012-12-25T16:30:00.000000Z'
type: object
HasLinks:
properties:
links:
type: array
items:
type: string
example: 'http://localhost/api/stations/1/queue/1'
type: object
Api_UploadFile:
properties:
path:
@ -2594,10 +2603,10 @@ components:
example: true
created_at:
type: integer
example: 1606584191
example: 1606746142
updated_at:
type: integer
example: 1606584191
example: 1606746142
type: object
Role:
properties:
@ -2718,93 +2727,97 @@ components:
nullable: true
type: object
StationMedia:
properties:
id:
type: integer
example: 1
album:
description: 'The name of the media file''s album.'
type: string
example: 'Test Album'
nullable: true
genre:
description: 'The genre of the media file.'
type: string
example: Rock
nullable: true
lyrics:
description: 'Full lyrics of the track, if available.'
type: string
example: '...Never gonna give you up...'
nullable: true
isrc:
description: 'The track ISRC (International Standard Recording Code), used for licensing purposes.'
type: string
example: GBARL0600786
nullable: true
length:
description: 'The song duration in seconds.'
type: number
format: float
example: 240
length_text:
description: 'The formatted song duration (in mm:ss format)'
type: string
example: '4:00'
nullable: true
path:
description: 'The relative path of the media file.'
type: string
example: test.mp3
nullable: true
mtime:
description: 'The UNIX timestamp when the database was last modified.'
type: integer
example: 1606584191
nullable: true
amplify:
description: 'The amount of amplification (in dB) to be applied to the radio source;'
type: number
format: float
example: -14
nullable: true
fade_overlap:
description: 'The length of time (in seconds) before the next song starts in the fade;'
type: number
format: float
example: 2
nullable: true
fade_in:
description: 'The length of time (in seconds) to fade in the next track;'
type: number
format: float
example: 3
nullable: true
fade_out:
description: 'The length of time (in seconds) to fade out the previous track;'
type: number
format: float
example: 3
nullable: true
cue_in:
description: 'The length of time (in seconds) from the start of the track to start playing;'
type: number
format: float
example: 30
nullable: true
cue_out:
description: 'The length of time (in seconds) from the CUE-IN of the track to stop playing;'
type: number
format: float
example: 30
nullable: true
art_updated_at:
description: 'The latest time (UNIX timestamp) when album art was updated.'
type: integer
example: 1606584191
playlists:
items: { }
type: object
allOf:
-
$ref: '#/components/schemas/UniqueId'
-
properties:
id:
type: integer
example: 1
album:
description: 'The name of the media file''s album.'
type: string
example: 'Test Album'
nullable: true
genre:
description: 'The genre of the media file.'
type: string
example: Rock
nullable: true
lyrics:
description: 'Full lyrics of the track, if available.'
type: string
example: '...Never gonna give you up...'
nullable: true
isrc:
description: 'The track ISRC (International Standard Recording Code), used for licensing purposes.'
type: string
example: GBARL0600786
nullable: true
length:
description: 'The song duration in seconds.'
type: number
format: float
example: 240
length_text:
description: 'The formatted song duration (in mm:ss format)'
type: string
example: '4:00'
nullable: true
path:
description: 'The relative path of the media file.'
type: string
example: test.mp3
nullable: true
mtime:
description: 'The UNIX timestamp when the database was last modified.'
type: integer
example: 1606746142
nullable: true
amplify:
description: 'The amount of amplification (in dB) to be applied to the radio source;'
type: number
format: float
example: -14
nullable: true
fade_overlap:
description: 'The length of time (in seconds) before the next song starts in the fade;'
type: number
format: float
example: 2
nullable: true
fade_in:
description: 'The length of time (in seconds) to fade in the next track;'
type: number
format: float
example: 3
nullable: true
fade_out:
description: 'The length of time (in seconds) to fade out the previous track;'
type: number
format: float
example: 3
nullable: true
cue_in:
description: 'The length of time (in seconds) from the start of the track to start playing;'
type: number
format: float
example: 30
nullable: true
cue_out:
description: 'The length of time (in seconds) from the CUE-IN of the track to stop playing;'
type: number
format: float
example: 30
nullable: true
art_updated_at:
description: 'The latest time (UNIX timestamp) when album art was updated.'
type: integer
example: 1606746142
playlists:
items: { }
StationMount:
properties:
id:
@ -3048,7 +3061,7 @@ components:
example: false
reactivate_at:
type: integer
example: 1606584191
example: 1606746142
nullable: true
schedule_items:
items: { }
@ -3090,7 +3103,7 @@ components:
type: array
items: { }
type: object
Trait_UniqueId:
UniqueId:
properties:
unique_id:
description: 'A unique identifier associated with this record.'
@ -3128,10 +3141,10 @@ components:
nullable: true
created_at:
type: integer
example: 1606584191
example: 1606746142
updated_at:
type: integer
example: 1606584191
example: 1606746142
roles:
items: { }
type: object
@ -3195,6 +3208,8 @@ tags:
name: 'Administration: Settings'
-
name: 'Administration: Stations'
-
name: 'Administration: Storage Locations'
-
name: Miscellaneous
externalDocs: