mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 17:27:22 +01:00
refactors to use a Plugin to parse --ci option
This commit is contained in:
7
bin/pest
7
bin/pest
@ -31,8 +31,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
$rootPath = dirname($autoloadPath, 2);
|
||||
$argv = new ArgvInput();
|
||||
|
||||
$workingEnv = $argv->hasParameterOption('--ci') ? 'ci' : 'local';
|
||||
$testSuite = TestSuite::getInstance($rootPath, $argv->getParameterOption('--test-directory', 'tests'), $workingEnv);
|
||||
$testSuite = TestSuite::getInstance($rootPath, $argv->getParameterOption('--test-directory', 'tests'));
|
||||
|
||||
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
|
||||
$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated);
|
||||
@ -46,9 +45,9 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
$args = $_SERVER['argv'];
|
||||
|
||||
// Let's remove any arguments that PHPUnit does not understand
|
||||
if ($argv->hasParameterOption(['--test-directory', '--ci'])) {
|
||||
if ($argv->hasParameterOption('--test-directory')) {
|
||||
foreach ($args as $key => $value) {
|
||||
if (strpos($value, '--test-directory') !== false || strpos($value, '--ci') !== false) {
|
||||
if (strpos($value, '--test-directory') !== false) {
|
||||
unset($args[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user