https://github.com/nimut/phpunit-merger
Merge multiple PHPUnit reports into one file
https://github.com/nimut/phpunit-merger
Last synced: 10 months ago
JSON representation
Merge multiple PHPUnit reports into one file
- Host: GitHub
- URL: https://github.com/nimut/phpunit-merger
- Owner: Nimut
- Created: 2017-12-17T14:02:27.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T08:38:22.000Z (almost 2 years ago)
- Last Synced: 2025-07-27T21:10:46.069Z (11 months ago)
- Language: PHP
- Homepage:
- Size: 80.1 KB
- Stars: 43
- Watchers: 3
- Forks: 32
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
Awesome Lists containing this project
README
# Merge multiple PHPUnit reports into one file
[](https://packagist.org/packages/nimut/phpunit-merger)
[](https://styleci.io/repos/114540931)

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](https://getcomposer.org/) to install the testing framework.
```bash
$ 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.
```bash
$ vendor/bin/phpunit-merger coverage [--html=] []
```
**Arguments**
- `directory`: Directory containing one or multiple files with PHP_CodeCoverage objects
- `file`: File where the merged result should be stored. Default: Standard output
**Options**
- `html`: Directory where the HTML report should be stored
- `lowUpperBound`: (optional) The lowUpperBound value to be used for HTML format
- `highLowerBound`: (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.
```bash
$ vendor/bin/phpunit-merger log
```
**Arguments**
- `directory`: Provides the directory containing one or multiple files in JUnit XML format
- `file`: File where the merged result should be stored