TestsCommands
extends AbstractCommands
in package
Class TestsCommands.
Table of Contents
Methods
- getConfigurationFile() : mixed
- Path to YAML configuration file containing command defaults.
- getJson() : array<string|int, mixed>
- Returns the JSON parsed content.
- getWorkingDir() : string
- Returns the current working directory.
- isWebsiteInstalled() : bool
- Check if the website is installed.
- toolkitCheckPhpcsRequirements() : mixed
- Make sure that the config file exists and configuration is correct.
- toolkitRunPhpcbf() : mixed
- Run PHP code autofixing.
- toolkitSetupPhpcs() : mixed
- Setup PHP code sniffer.
- toolkitTestBehat() : mixed
- Run Behat tests.
- toolkitTestPhpcs() : mixed
- Run PHP code sniffer.
- toolkitTestPhpmd() : mixed
- Run PHPMD.
- toolkitTestPhpstan() : mixed
- Run PHPStan.
- toolkitTestPhpunit() : mixed
- Run PHPUnit tests.
- getBin() : string
- Validate and return the path to given bin.
- getBinPath() : string
- Return the path to given bin.
- getConfigValue() : mixed
- {@inheritdoc}
- getNodeBin() : string
- Validate and return the path to given bin from node packages.
- getNodeBinPath() : string
- Return the path to given bin from node packages.
- isJunit() : bool
- Check whether Junit option is being used, or env var is set.
- isSimulating() : bool
- Check if current command is being executed with option simulate.
- taskExecute() : mixed
- Execute a command.
- taskProcess() : mixed
- Process the file.
- taskReplaceBlock() : mixed
- Replace block in a file.
- toolkitRunGrumphp() : mixed
- Run PHP code sniffer within GrumPHP.
- toolkitRunPhpcs() : mixed
- Run PHP code sniffer.
- toolkitTestPhpunitParallelTask() : mixed
- Returns the task to execute PHPUnit in parallel.
Methods
getConfigurationFile()
Path to YAML configuration file containing command defaults.
public
getConfigurationFile() : mixed
getJson()
Returns the JSON parsed content.
public
getJson(string $filename[, mixed $throwException = true ]) : array<string|int, mixed>
Parameters
- $filename : string
- $throwException : mixed = true
Return values
array<string|int, mixed>getWorkingDir()
Returns the current working directory.
public
getWorkingDir() : string
Return values
string —The current working directory.
isWebsiteInstalled()
Check if the website is installed.
public
isWebsiteInstalled() : bool
Return values
booltoolkitCheckPhpcsRequirements()
Make sure that the config file exists and configuration is correct.
public
toolkitCheckPhpcsRequirements() : mixed
Tags
toolkitRunPhpcbf()
Run PHP code autofixing.
public
toolkitRunPhpcbf() : mixed
Tags
toolkitSetupPhpcs()
Setup PHP code sniffer.
public
toolkitSetupPhpcs() : mixed
Check configurations at config/default.yml - 'toolkit.test.phpcs'.
Tags
toolkitTestBehat()
Run Behat tests.
public
toolkitTestBehat([array<string|int, mixed> $options = ['from' => InputOption::VALUE_OPTIONAL, 'to' => InputOption::VALUE_OPTIONAL, 'profile' => InputOption::VALUE_OPTIONAL, 'suite' => InputOption::VALUE_OPTIONAL, 'options' => InputOption::VALUE_OPTIONAL] ]) : mixed
Check configurations at config/default.yml - 'toolkit.test.behat'. Accept commands to run before and/or after the Behat tests.
Parameters
- $options : array<string|int, mixed> = ['from' => InputOption::VALUE_OPTIONAL, 'to' => InputOption::VALUE_OPTIONAL, 'profile' => InputOption::VALUE_OPTIONAL, 'suite' => InputOption::VALUE_OPTIONAL, 'options' => InputOption::VALUE_OPTIONAL]
Tags
toolkitTestPhpcs()
Run PHP code sniffer.
public
toolkitTestPhpcs() : mixed
Tags
toolkitTestPhpmd()
Run PHPMD.
public
toolkitTestPhpmd(ConsoleIO $io[, array<string|int, mixed> $options = ['config' => InputOption::VALUE_REQUIRED, 'format' => InputOption::VALUE_REQUIRED, 'ignore_patterns' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'triggered_by' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'files' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY] ]) : mixed
Check configurations at config/default.yml - 'toolkit.test.phpmd'.
Parameters
- $io : ConsoleIO
- $options : array<string|int, mixed> = ['config' => InputOption::VALUE_REQUIRED, 'format' => InputOption::VALUE_REQUIRED, 'ignore_patterns' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'triggered_by' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'files' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY]
Tags
toolkitTestPhpstan()
Run PHPStan.
public
toolkitTestPhpstan([array<string|int, mixed> $options = ['config' => InputOption::VALUE_REQUIRED, 'level' => InputOption::VALUE_REQUIRED, 'files' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'memory-limit' => InputOption::VALUE_OPTIONAL, 'options' => InputOption::VALUE_OPTIONAL] ]) : mixed
Check configurations at config/default.yml - 'toolkit.test.phpstan'.
Parameters
- $options : array<string|int, mixed> = ['config' => InputOption::VALUE_REQUIRED, 'level' => InputOption::VALUE_REQUIRED, 'files' => InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'memory-limit' => InputOption::VALUE_OPTIONAL, 'options' => InputOption::VALUE_OPTIONAL]
Tags
toolkitTestPhpunit()
Run PHPUnit tests.
public
toolkitTestPhpunit([array<string|int, mixed> $options = ['execution' => InputOption::VALUE_REQUIRED, 'from' => InputOption::VALUE_REQUIRED, 'to' => InputOption::VALUE_REQUIRED, 'testsuite' => InputOption::VALUE_REQUIRED, 'group' => InputOption::VALUE_REQUIRED, 'covers' => InputOption::VALUE_REQUIRED, 'uses' => InputOption::VALUE_REQUIRED, 'filter' => InputOption::VALUE_REQUIRED, 'options' => InputOption::VALUE_REQUIRED, 'printer' => InputOption::VALUE_NONE] ]) : mixed
Check configurations at config/default.yml - 'toolkit.test.phpunit'. Accept commands to run before and/or after the PHPUnit tests.
Parameters
- $options : array<string|int, mixed> = ['execution' => InputOption::VALUE_REQUIRED, 'from' => InputOption::VALUE_REQUIRED, 'to' => InputOption::VALUE_REQUIRED, 'testsuite' => InputOption::VALUE_REQUIRED, 'group' => InputOption::VALUE_REQUIRED, 'covers' => InputOption::VALUE_REQUIRED, 'uses' => InputOption::VALUE_REQUIRED, 'filter' => InputOption::VALUE_REQUIRED, 'options' => InputOption::VALUE_REQUIRED, 'printer' => InputOption::VALUE_NONE]
Tags
getBin()
Validate and return the path to given bin.
protected
getBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getBinPath()
Return the path to given bin.
protected
getBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
getConfigValue()
{@inheritdoc}
protected
getConfigValue(mixed $key[, mixed $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed = null
getNodeBin()
Validate and return the path to given bin from node packages.
protected
getNodeBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getNodeBinPath()
Return the path to given bin from node packages.
protected
getNodeBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
isJunit()
Check whether Junit option is being used, or env var is set.
protected
isJunit() : bool
Return values
boolisSimulating()
Check if current command is being executed with option simulate.
protected
isSimulating() : bool
Return values
bool —True if using --simulate, false otherwise.
taskExecute()
Execute a command.
protected
taskExecute(array<string|int, mixed> $tasks) : mixed
Parameters
- $tasks : array<string|int, mixed>
-
An array with tasks to execute.
taskProcess()
Process the file.
protected
taskProcess(string $source[, string $destination = '' ]) : mixed
Parameters
- $source : string
-
The source file to process.
- $destination : string = ''
-
The destination file.
taskReplaceBlock()
Replace block in a file.
protected
taskReplaceBlock([string $filename = '' ]) : mixed
Parameters
- $filename : string = ''
-
The file to process.
toolkitRunGrumphp()
Run PHP code sniffer within GrumPHP.
protected
toolkitRunGrumphp() : mixed
Tags
toolkitRunPhpcs()
Run PHP code sniffer.
protected
toolkitRunPhpcs() : mixed
Check configurations at config/default.yml - 'toolkit.test.phpcs'.
toolkitTestPhpunitParallelTask()
Returns the task to execute PHPUnit in parallel.
private
toolkitTestPhpunitParallelTask(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
-
The options passed to the command test-phpunit.