vitorsreis/phpunit-dispatcher-phar

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

1.0.0 2025-05-03 05:35 UTC

This package is auto-updated.

Last update: 2025-05-03 05:36:11 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
  • Caching mechanism for faster subsequent runs

Installation

Using Composer

composer require --dev vitorsreis/phpunit-dispatcher-phar

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

Contributing

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