phpunitHow to run tests in parallel with PHPUnit?
PHPUnit supports running tests in parallel using the --process-isolation
option. This option will run each test in a separate process, allowing them to run in parallel.
phpunit --process-isolation
The output of the command will look something like this:
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.
Runtime: PHP 7.4.3
Configuration: /path/to/phpunit.xml
............................................................ 63 / 63 (100%)
Time: 00:00.845, Memory: 10.00 MB
OK (63 tests, 63 assertions)
The --process-isolation
option can also be used in combination with other options, such as --testsuite
to run tests in a specific test suite in parallel.
phpunit --process-isolation --testsuite MyTestSuite
For more information, see the PHPUnit documentation.
More of Phpunit
- How to skip a PHPUnit test?
- How to mock a method with different arguments in PHPUnit?
- How to run all PHPUnit tests?
- How to run only certain methods in PHPUnit?
- How to mock a static method with PHPUnit?
- How to mock a query builder with PHPUnit?
- How to launch one test with PHPUnit?
- How to check if a JSON contains a value in PHPUnit?
- How to use hooks in PHPUnit?
See more codes...