WinterTest
Console command to run tests for plugins and modules.
class System\Console\WinterTest
extends Illuminate\Console\Command
If a plugin is provided, this command will search for a phpunit.xml
file inside the plugin's directory and run its tests.
Extends
Class | Description |
---|---|
Illuminate\Console\Command
|
Properties
protected
static
$defaultName
:
string
|
null
= "winter:test"
The default command name for lazy loading.
protected
$description
:
string
= "Run tests for the Winter CMS core or an existing plugin."
The console command description.
protected
$name
:
string
= "winter:test"
The console command name.
protected
$phpUnitExec
:
?string
= null
Path to phpunit binary
protected
$signature
:
string
= "winter:test\n {phpunitArgs?* : Arguments to pass through to PHPUnit}\n {?--c|configuration= : A specific phpunit xml file}\n {?--b|bootstrap= : A custom PHPUnit bootstrap file}\n {?--p|plugin=* : List of plugins to test}\n {?--m|module=* : List of modules to test}\n "
The console command signature as ignoreValidationErrors causes options not to be registered.
Methods
public __construct () : void
Create a new command instance.
Returns
void
public handle () : int | void
Execute the console command.
Returns
int | void
protected execPhpUnit (string $config, array $args) : integer
Execute a phpunit test
Parameters
Property | Type | Description |
---|---|---|
$config | string |
string
Path to configuration file |
$args | array |
array
Array of params for PHPUnit |
Returns
integer
Exit code from process
protected getPhpUnitConfigs () : array
Find all PHPUnit config files (core, lib, plugins)
Returns
array
protected getPhpUnitXmlFile (string $path) : string | null
Search for the config file to use.
Priority order is: phpunit.xml, phpunit.xml.dist
Parameters
Property | Type | Description |
---|---|---|
$path | string |
string
|
Returns
string | null
protected usingPest () : bool
Determines if Pest is being used.
Returns
bool
Copyright © 2024 Winter CMS