vitorsreis/phpunit-dispatcher

PHPUnit Dispatcher - A tool that automatically selects and runs the appropriate PHPUnit Phar version based on your PHP version.

1.0.0 2025-05-05 04:56 UTC

This package is auto-updated.

Last update: 2025-05-05 04:57:23 UTC


README

Latest Version Total Downloads License PHP Version

A tool that automatically selects and runs the appropriate PHPUnit PHAR version based on your PHP version.

Description

PHPUnit Dispatcher is a smart wrapper for PHPUnit that automatically selects the correct PHAR version based on your current PHP version. This eliminates the need to manually manage different PHPUnit versions for different PHP environments.

Features

  • Automatically detects your PHP version
  • Selects the appropriate PHPUnit version
  • Runs PHPUnit with all your specified arguments
  • Easy to use - just run it like you would run PHPUnit
  • Lightweight - no additional dependencies required
  • Support simultaneous processes with same or different PHPUnit versions
  • Caching mechanism for faster subsequent runs

Installation

Using Composer

composer require --dev vitorsreis/phpunit-dispatcher

After installation, the phpunit-dispatcher.phar file will be available in vendor/bin/phpunit-dispatcher.phar.

Manual Installation

Download the latest release from the releases page

Usage

Use it exactly like you would use PHPUnit:

php phpunit-dispatcher.phar [options]

For example:

php phpunit-dispatcher.phar --version

php phpunit-dispatcher.phar tests/

Cache / Update:

The first time you run the PHPUnit Dispatcher, it will download the appropriate PHPUnit PHAR version for your PHP version and store in cache. This allows for faster subsequent runs. You can force the PHPUnit version update using the --pud-force-update argument:

php phpunit-dispatcher.phar --pud-force-update

Building from Source

To build the project from source:

  1. Clone the repository
  2. Build the Phar file:
composer run-script build

Verbose Mode:

To enable verbose mode with additional logs during execution, use the --pud-verbose argument:

php phpunit-dispatcher.phar --pud-verbose

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author