refactors to use a Plugin to parse --ci option

This commit is contained in:
Fabio Ivona
2021-09-22 14:53:16 +02:00
parent 05c1c82ae2
commit 601c4b01fc
8 changed files with 100 additions and 28 deletions

View File

@ -73,13 +73,6 @@ final class TestSuite
*/
public $testPath;
/**
* Holds the current working environment identifier.
*
* @var string
*/
public $workingEnv;
/**
* Holds an instance of the test suite.
*
@ -100,17 +93,15 @@ final class TestSuite
$this->rootPath = (string) realpath($rootPath);
$this->testPath = $testPath;
$this->workingEnv = 'local';
}
/**
* Returns the current instance of the test suite.
*/
public static function getInstance(string $rootPath = null, string $testPath = null, string $workingEnv = null): TestSuite
public static function getInstance(string $rootPath = null, string $testPath = null): TestSuite
{
if (is_string($rootPath) && is_string($testPath)) {
self::$instance = new TestSuite($rootPath, $testPath);
self::$instance->workingEnv = $workingEnv ?? 'local';
self::$instance = new TestSuite($rootPath, $testPath);
foreach (Plugin::$callables as $callable) {
$callable();