This commit is contained in:
Luke Downing
2023-02-08 13:48:42 +00:00
committed by Nuno Maduro
parent dd840f8861
commit a34001faf0
7 changed files with 45 additions and 41 deletions

View File

@ -37,17 +37,17 @@ final class Laravel
private function setLaravelParallelRunner(): void
{
if (!method_exists(ParallelRunner::class, 'resolveRunnerUsing')) {
if (! method_exists(ParallelRunner::class, 'resolveRunnerUsing')) {
exit('Using parallel with Pest requires Laravel v8.55.0 or higher.');
}
ParallelRunner::resolveRunnerUsing(fn(Options $options, OutputInterface $output): RunnerInterface => new WrapperRunner($options, $output));
ParallelRunner::resolveRunnerUsing(fn (Options $options, OutputInterface $output): RunnerInterface => new WrapperRunner($options, $output));
}
private static function isALaravelApplication(): bool
{
return class_exists(\Illuminate\Foundation\Application::class)
&& class_exists(\Illuminate\Testing\ParallelRunner::class)
&& !class_exists(\Orchestra\Testbench\TestCase::class);
&& ! class_exists(\Orchestra\Testbench\TestCase::class);
}
}

View File

@ -6,7 +6,6 @@ namespace Pest\Plugins\Parallel\Handlers;
use Pest\Plugins\Concerns\HandleArguments;
use Pest\Plugins\Parallel\Paratest\WrapperRunner;
use Symfony\Component\Console\Input\ArgvInput;
/**
* @internal
@ -14,6 +13,7 @@ use Symfony\Component\Console\Input\ArgvInput;
final class Parallel
{
use HandleArguments;
/**
* @var string[]
*/
@ -27,6 +27,6 @@ final class Parallel
{
$args = array_reduce(self::ARGS_TO_REMOVE, fn ($args, $arg): array => $this->popArgument($arg, $args), $args);
return $this->pushArgument('--runner=' . WrapperRunner::class, $args);
return $this->pushArgument('--runner='.WrapperRunner::class, $args);
}
}