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 show warnings in PHPUnit?
- How to stop PHPUnit on failure?
- How to skip a PHPUnit test?
- How to run all PHPUnit tests?
- How to mock a method with different arguments in PHPUnit?
- How to use hooks in PHPUnit?
- How to ignore a test in PHPUnit?
- How to run PHPUnit in a Docker container?
- How to use dependency injection in PHPUnit?
See more codes...