diff --git a/bin/pest-wrapper.php b/bin/pest-wrapper.php index 2dbe4be5..9e014558 100644 --- a/bin/pest-wrapper.php +++ b/bin/pest-wrapper.php @@ -8,6 +8,7 @@ use Pest\ConfigLoader; use Pest\Kernel; use Pest\Plugins\Actions\CallsHandleArguments; use Pest\Support\Container; +use Pest\TestCaseMethodFilters\TodoTestCaseFilter; use Pest\TestSuite; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\InputInterface; @@ -16,12 +17,18 @@ use Symfony\Component\Console\Output\OutputInterface; $bootPest = (static function (): void { $argv = new ArgvInput(); + $originalArgv = new ArgvInput(json_decode($_SERVER['PEST_PARALLEL_ARGV'])); + $rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2); $testSuite = TestSuite::getInstance( $rootPath, $argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()), ); + if ($originalArgv->hasParameterOption('--todo')) { + $testSuite->tests->addTestCaseMethodFilter(new TodoTestCaseFilter()); + } + $output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, true); $container = Container::getInstance(); diff --git a/src/Plugins/Parallel.php b/src/Plugins/Parallel.php index d4e39d73..7a959afe 100644 --- a/src/Plugins/Parallel.php +++ b/src/Plugins/Parallel.php @@ -64,6 +64,8 @@ final class Parallel implements HandlesArguments return Command::FAILURE; } + $_ENV['PEST_PARALLEL_ARGV'] = json_encode($_SERVER['argv']); + $handlers = array_filter( array_map(fn ($handler) => Container::getInstance()->get($handler), self::HANDLERS), fn ($handler) => $handler instanceof HandlesArguments,