mirror of
https://github.com/pestphp/pest.git
synced 2026-03-05 23:37:22 +01:00
WIP
This commit is contained in:
committed by
Nuno Maduro
parent
7fe7a01d43
commit
504fd04705
@ -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();
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user