mridang / phpunit-reporters
A PHPUnit reporter that displays code coverage in the console.
Installs: 53
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/mridang/phpunit-reporters
Requires
- php: ^8.3
- ext-libxml: *
- ext-simplexml: *
- phpunit/phpunit: ^10.0 || ^11.0 || ^12.0
- symfony/console: ^6.0 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- icanhazstring/composer-unused: ^0.9.3
- phpstan/phpstan: ^1.12
- phpstan/phpstan-symfony: ^1.4
- rector/rector: ^1.2
This package is auto-updated.
Last update: 2025-12-28 22:46:03 UTC
README
phpunit-reporters is a PHPUnit extension that displays code coverage results in Jest/Istanbul's console format with a directory tree structure.
Why?
Using phpunit-reporters lets you see coverage in Jest's familiar table format right in your terminal. The reporter organizes files into a directory tree, shows uncovered line ranges (e.g., 5-12,18), and applies the same color coding as Jest so your PHP coverage reports look exactly like your JavaScript ones.
Usage
Add the package to your project:
composer require --dev mridang/phpunit-reporters
Then run your tests with coverage:
vendor/bin/phpunit --coverage-clover build/coverage/clover.xml
The Jest-style coverage table will automatically appear at the end of your test run.
Options
The plugin automatically detects terminal width and formats output accordingly. Coverage data is read from PHPUnit's clover.xml report, so use standard PHPUnit coverage options:
vendor/bin/phpunit --coverage-clover build/coverage/clover.xml
Ensure Xdebug or PCOV is installed and configured for coverage collection.
Contributing
Contributions are welcome! If you find a bug or have suggestions for improvement, please open an issue or submit a pull request.
License
Apache License 2.0 © 2025 Mridang Agarwalla