Skip to content

Commit

Permalink
Adds support for Pest parallel testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeraymonddowning committed Aug 13, 2021
1 parent 0f0f46b commit 9898c33
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/Adapters/Laravel/Commands/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 9898c33

Please sign in to comment.