mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47: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\Kernel;
|
||||||
use Pest\Plugins\Actions\CallsHandleArguments;
|
use Pest\Plugins\Actions\CallsHandleArguments;
|
||||||
use Pest\Support\Container;
|
use Pest\Support\Container;
|
||||||
|
use Pest\TestCaseMethodFilters\TodoTestCaseFilter;
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
@ -16,12 +17,18 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
|
|
||||||
$bootPest = (static function (): void {
|
$bootPest = (static function (): void {
|
||||||
$argv = new ArgvInput();
|
$argv = new ArgvInput();
|
||||||
|
$originalArgv = new ArgvInput(json_decode($_SERVER['PEST_PARALLEL_ARGV']));
|
||||||
|
|
||||||
$rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2);
|
$rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2);
|
||||||
$testSuite = TestSuite::getInstance(
|
$testSuite = TestSuite::getInstance(
|
||||||
$rootPath,
|
$rootPath,
|
||||||
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($originalArgv->hasParameterOption('--todo')) {
|
||||||
|
$testSuite->tests->addTestCaseMethodFilter(new TodoTestCaseFilter());
|
||||||
|
}
|
||||||
|
|
||||||
$output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, true);
|
$output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, true);
|
||||||
|
|
||||||
$container = Container::getInstance();
|
$container = Container::getInstance();
|
||||||
|
|||||||
@ -64,6 +64,8 @@ final class Parallel implements HandlesArguments
|
|||||||
return Command::FAILURE;
|
return Command::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$_ENV['PEST_PARALLEL_ARGV'] = json_encode($_SERVER['argv']);
|
||||||
|
|
||||||
$handlers = array_filter(
|
$handlers = array_filter(
|
||||||
array_map(fn ($handler) => Container::getInstance()->get($handler), self::HANDLERS),
|
array_map(fn ($handler) => Container::getInstance()->get($handler), self::HANDLERS),
|
||||||
fn ($handler) => $handler instanceof HandlesArguments,
|
fn ($handler) => $handler instanceof HandlesArguments,
|
||||||
|
|||||||
Reference in New Issue
Block a user