nimut / phpunit-merger
Merge multiple PHPUnit reports into one file
Installs: 971 626
Dependents: 7
Suggesters: 0
Security: 0
Stars: 42
Watchers: 4
Forks: 29
Open Issues: 7
Requires
- php: ^8.0
- ext-dom: *
- ext-json: *
- ext-simplexml: *
- phpunit/php-code-coverage: ^9.0 || ^10.0
- symfony/console: >=2.7 <8.0
- symfony/finder: >=2.7 <8.0
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.4
- phpspec/prophecy: ^1.0
- phpunit/phpunit: ^9.3 || ^10.0
- symfony/filesystem: >=2.7 <8.0
Suggests
- friendsofphp/php-cs-fixer: Tool to automatically fix PHP coding standards issues
README
Sometimes it is necessary to run multiple PHPUnit instances to execute all tests of a project. Unfortunately each run writes its own coverage and log reports. There is no support in PHPUnit to merge the reports of multiple runs.
This project provides two commands to merge coverage files as well as log files. It was designed to provide merged reports to e.g. SonarQube Scanner for further processing.
Installation
Use Composer to install the testing framework.
$ composer require --dev nimut/phpunit-merger
Composer will add the package as a dev requirement to your composer.json and install the package with its dependencies.
Usage
Coverage
The coverage command merges files containing PHP_CodeCoverage objects into one file in Clover XML format.
$ vendor/bin/phpunit-merger coverage <directory> [--html=<directory>] [<file>]
Arguments
directory
: Directory containing one or multiple files with PHP_CodeCoverage objectsfile
: File where the merged result should be stored. Default: Standard output
Options
html
: Directory where the HTML report should be storedlowUpperBound
: (optional) The lowUpperBound value to be used for HTML formathighLowerBound
: (optional) The highLowerBound value to be used for HTML format
Log
The log command merges files in JUnit XML format into one file in JUnit XML format.
$ vendor/bin/phpunit-merger log <directory> <file>
Arguments
directory
: Provides the directory containing one or multiple files in JUnit XML formatfile
: File where the merged result should be stored