mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 01:37:21 +01:00
adds a new --ci option to pest binary
This commit is contained in:
@ -119,6 +119,10 @@ final class TestRepository
|
||||
*/
|
||||
private function testsUsingOnly(): array
|
||||
{
|
||||
if (TestSuite::getInstance()->workingEnv === 'ci') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_filter($this->state, function ($testFactory): bool {
|
||||
return $testFactory->only;
|
||||
});
|
||||
|
||||
@ -73,6 +73,13 @@ final class TestSuite
|
||||
*/
|
||||
public $testPath;
|
||||
|
||||
/**
|
||||
* Holds the current working environment identifier.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $workingEnv;
|
||||
|
||||
/**
|
||||
* Holds an instance of the test suite.
|
||||
*
|
||||
@ -98,10 +105,11 @@ final class TestSuite
|
||||
/**
|
||||
* Returns the current instance of the test suite.
|
||||
*/
|
||||
public static function getInstance(string $rootPath = null, string $testPath = null): TestSuite
|
||||
public static function getInstance(string $rootPath = null, string $testPath = null, string $workingEnv = null): TestSuite
|
||||
{
|
||||
if (is_string($rootPath) && is_string($testPath)) {
|
||||
self::$instance = new TestSuite($rootPath, $testPath);
|
||||
self::$instance->workingEnv = $workingEnv;
|
||||
|
||||
foreach (Plugin::$callables as $callable) {
|
||||
$callable();
|
||||
|
||||
Reference in New Issue
Block a user