fix: dirty argument

This commit is contained in:
Nuno Maduro
2023-01-11 20:17:51 +00:00
parent 349e2f45df
commit 217fae0967

View File

@ -16,6 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface;
$_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter'; $_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter';
$args = $_SERVER['argv']; $args = $_SERVER['argv'];
$dirty = false;
foreach ($args as $key => $value) { foreach ($args as $key => $value) {
if (str_contains($value, '--compact')) { if (str_contains($value, '--compact')) {
@ -33,6 +34,7 @@ use Symfony\Component\Console\Output\OutputInterface;
} }
if (str_contains($value, '--dirty')) { if (str_contains($value, '--dirty')) {
$dirty = true;
unset($args[$key]); unset($args[$key]);
} }
@ -66,10 +68,8 @@ use Symfony\Component\Console\Output\OutputInterface;
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()), $argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
); );
foreach ($args as $key => $value) { if ($dirty) {
if (str_contains($value, '--dirty')) { $testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath));
$testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath));
}
} }
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never'; $isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';