From 9898c33d75727a417ac4598d476b0906f6b7aab2 Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 13 Aug 2021 14:56:21 +0100 Subject: [PATCH] Adds support for Pest parallel testing. --- src/Adapters/Laravel/Commands/TestCommand.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Adapters/Laravel/Commands/TestCommand.php b/src/Adapters/Laravel/Commands/TestCommand.php index 668f72b3..9019ea88 100644 --- a/src/Adapters/Laravel/Commands/TestCommand.php +++ b/src/Adapters/Laravel/Commands/TestCommand.php @@ -120,23 +120,17 @@ public function handle() */ protected function binary() { - switch (true) { - case $this->option('parallel'): - $command = 'vendor/brianium/paratest/bin/paratest'; - break; - case class_exists(\Pest\Laravel\PestServiceProvider::class): - $command = 'vendor/pestphp/pest/bin/pest'; - break; - default: - $command = 'vendor/phpunit/phpunit/phpunit'; - break; + if (class_exists(\Pest\Laravel\PestServiceProvider::class)) { + $command = $this->option('parallel') ? ['vendor/pestphp/pest/bin/pest', '--parallel'] : ['vendor/pestphp/pest/bin/pest']; + } else { + $command = $this->option('parallel') ? ['vendor/brianium/paratest/bin/paratest'] : ['vendor/phpunit/phpunit/phpunit']; } if ('phpdbg' === PHP_SAPI) { - return [PHP_BINARY, '-qrr', $command]; + return array_merge([PHP_BINARY, '-qrr'], $command); } - return [PHP_BINARY, $command]; + return array_merge([PHP_BINARY], $command); } /**