brianium/paratest
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
fidry/cpu-core-counter | 1.1.0 | 26.15 kB | MIT | prod | |
jean85/pretty-package-versions | 2.0.6 | - | MIT | prod | |
phpunit/php-code-coverage | 11.0.3 | - | BSD-3-Clause | prod dev | |
phpunit/php-file-iterator | 5.0.0 | 9.42 kB | BSD-3-Clause | prod dev | |
phpunit/php-timer | 7.0.0 | - | BSD-3-Clause | prod dev | |
phpunit/phpunit | 11.1.3 | - | BSD-3-Clause | prod dev | |
sebastian/environment | 7.1.0 | - | BSD-3-Clause | prod dev | |
symfony/console | v7.0.7 | - | MIT | prod | |
symfony/process | v7.0.7 | - | MIT | prod dev |
The brianium/paratest is a parallel testing tool for PHP. It aims to support parallel testing in PHPUnit. The major benefit of this package is that it requires zero configuration. It can easily be dropped into your project to begin using it as long as you have well-written PHPUnit tests. It has the ability to run tests in parallel by TestCase or by Test, and all the code coverage output from running your tests in parallel processes will be combined into one report.
Using brianium/paratest is quite straightforward. First, you need to install it with composer by running the command composer require --dev brianium/paratest
. After installation, you can find the binary at vendor/bin/paratest
. You can then run this binary with the --help
option to see a complete list of the available options. Here's a basic usage example:
if (getenv('TEST_TOKEN') !== false) { // Using ParaTest
$dbname = 'testdb_' . getenv('TEST_TOKEN');
} else {
$dbname = 'testdb';
}
For code coverage, you can use PCOV or xDebug.
For PCOV, this code sample shows how to pass the required PHP binary option:
php -d pcov.enabled=1 vendor/bin/paratest --passthru-php="'-d' 'pcov.enabled=1'"
For xDebug, environment variable activation is enough for it to run even in the subprocesses:
XDEBUG_MODE=coverage vendor/bin/paratest
You can find the documentation for brianium/paratest right within its GitHub repository at https://github.com/paratestphp/paratest
. The detailed readme file serves as a comprehensive guide on how to install, use, and troubleshoot the package. You will also find information about the versions supported, how to integrate with PHPStorm, and some of the caveats to be aware of.