Download the PHP package brianium/paratest without Composer

On this page you can find all versions of the php package brianium/paratest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package paratest

ParaTest

Latest Stable Version Downloads Integrate Infection MSI

The objective of ParaTest is to support parallel testing in PHPUnit. Provided you have well-written PHPUnit tests, you can drop paratest in your project and start using it with no additional bootstrap or configurations!

Benefits:

Installation

To install with composer run the following command:

composer require --dev brianium/paratest

Versions

Only the latest version of PHPUnit is supported, and thus only the latest version of ParaTest is actively maintained.

This is because of the following reasons:

  1. To reduce bugs, code duplication and incompatibilities with PHPUnit, from version 5 ParaTest heavily relies on PHPUnit @internal classes
  2. The fast pace both PHP and PHPUnit have taken recently adds too much maintenance burden, which we can only afford for the latest versions to stay up-to-date

Usage

After installation, the binary can be found at vendor/bin/paratest. Run it with --help option to see a complete list of the available options.

Test token

The TEST_TOKEN environment variable is guaranteed to have a value that is different from every other currently running test. This is useful to e.g. use a different database for each test:

A UNIQUE_TEST_TOKEN environment variable is also available and guaranteed to have a value that is unique both per run and per process.

Code coverage

The cache is always warmed up by ParaTest before executing the test suite.

PCOV

If you have installed pcov but need to enable it only while running tests, you have to pass thru the needed PHP binary option:

xDebug

If you have xDebug installed, activating it by the environment variable is enough to have it running even in the subprocesses:

Initial setup for all tests

Because ParaTest runs multiple processes in parallel, each with their own instance of the PHP interpreter, techniques used to perform an initialization step exactly once for each test work different from PHPUnit. The following pattern will not work as expected - run the initialization exactly once - and instead run the initialization once per process:

This is because static variables persist during the execution of a single process. In parallel testing each process has a separate instance of $initialized. You can use the following pattern to ensure your initialization runs exactly once for the entire test invocation:

Troubleshooting

If you run into problems with paratest, try to get more information about the issue by enabling debug output via --verbose --debug.

When a sub-process fails, the originating command is given in the output and can then be copy-pasted in the terminal to be run and debugged. All internal commands run with --printer [...]\NullPhpunitPrinter which silence the original PHPUnit output: during a debugging run remove that option to restore the output and see what PHPUnit is doing.

Caveats

  1. Constants, static methods, static variables and everything exposed by test classes consumed by other test classes (including Reflection) are not supported. This is due to a limitation of the current implementation of WrapperRunner and how PHPUnit searches for classes. The fix is to put shared code into classes which are not tests themselves.

Integration with PHPStorm

ParaTest provides a dedicated binary to work with PHPStorm; follow these steps to have ParaTest working within it:

  1. Be sure you have PHPUnit already configured in PHPStorm: https://www.jetbrains.com/help/phpstorm/using-phpunit-framework.html#php_test_frameworks_phpunit_integrate
  2. Go to Run -> Edit configurations...
  3. Select Add new Configuration, select the PHPUnit type and name it ParaTest
  4. In the Command Line -> Interpreter options add ./vendor/bin/paratest_for_phpstorm
  5. Any additional ParaTest options you want to pass to ParaTest should go within the Test runner -> Test runner options section

You should now have a ParaTest run within your configurations list. It should natively work with the Rerun failed tests and Toggle auto-test buttons of the Run overlay.

Run with Coverage

Coverage with one of the configured in PHPStorm and working when running tests sequentially in order for the helper binary to correctly handle code coverage

For Contributors: testing ParaTest itself

Before creating a Pull Request be sure to run all the necessary checks with make command.


All versions of paratest with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0
ext-dom Version *
ext-pcre Version *
ext-reflection Version *
ext-simplexml Version *
fidry/cpu-core-counter Version ^1.2.0
jean85/pretty-package-versions Version ^2.0.6
phpunit/php-code-coverage Version ^11.0.7
phpunit/php-file-iterator Version ^5.1.0
phpunit/php-timer Version ^7.0.1
phpunit/phpunit Version ^11.4.1
sebastian/environment Version ^7.2.0
symfony/console Version ^6.4.11 || ^7.1.5
symfony/process Version ^6.4.8 || ^7.1.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package brianium/paratest contains the following files

Loading the files please wait ....