Laravel recently added parallel testing to the framework using the Paratest package which runs PHPUnit in separate parallel processes. Adding support for this in your own package tests is pretty straightforward using orchestral/testbench.
Testbench and more specifically testbench-core has added support for Laravel's parallel testing since 6.12.0, but it's recommended to at least use 6.19.0 where the new package:test
command is hard-loaded instead of using package discovery. Using this inside your own package tests is very straightforward:
This step isn't strictly necessary, as the command below will check for these and suggest them to be installed, but it's a bit faster to have them installed in advance.
composer require --dev brianium/paratest nunomaduro/collision
Testbench has a new package:test
command that mimics Laravel's test command, which sets up everything you need to have your package tested within Testbench's default Laravel project. You can run this with the --parallel
flag to enable parallel testing.
./vendor/bin/testbench package:test --parallel