diff --git a/bin/pest b/bin/pest index c18c3df9..254265f8 100755 --- a/bin/pest +++ b/bin/pest @@ -2,10 +2,7 @@ hasParameterOption('--test-directory')) { - foreach ($_SERVER['argv'] as $key => $value) { + foreach ($args as $key => $value) { if (strpos($value, '--test-directory') !== false) { - unset($_SERVER['argv'][$key]); + unset($args[$key]); } } } - $_SERVER['argv'] = InteractsWithPlugins::handleArguments($_SERVER['argv']); + $command = $argv->hasParameterOption(['--parallel', '-P']) + ? \Pest\Parallel\Command::class + : \Pest\Console\Command::class; - if ($argv->hasParameterOption('--parallel')) { - exit(ParaTestCommand::applicationFactory($testSuite->rootPath)->run(new ArgvInput())); - } - - exit($container->get(Command::class)->run($_SERVER['argv'])); + exit($container->get($command)->run($args)); })(); diff --git a/src/Console/Command.php b/src/Console/Command.php index 06750381..a6ce762e 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -9,8 +9,6 @@ use Pest\Actions\AddsTests; use Pest\Actions\InteractsWithPlugins; use Pest\Actions\LoadStructure; use Pest\Actions\ValidatesConfiguration; -use Pest\Contracts\Plugins\AddsOutput; -use Pest\Plugin\Loader; use Pest\Plugins\Version; use Pest\Support\Container; use Pest\TestSuite; @@ -57,6 +55,8 @@ final class Command extends BaseCommand */ protected function handleArguments(array $argv): void { + $argv = InteractsWithPlugins::handleArguments($argv); + parent::handleArguments($argv); /*