Skip to content

Merge multiple PHPUnit reports into one file

Notifications You must be signed in to change notification settings

vemaeg/phpunit-merger

This branch is 12 commits ahead of, 23 commits behind Nimut/phpunit-merger:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2f4ba8b · Jan 14, 2024

History

76 Commits
Dec 9, 2018
Jan 14, 2024
Jul 18, 2023
Jul 18, 2023
Aug 18, 2020
Aug 18, 2020
Jan 17, 2022
Jan 18, 2022
Oct 2, 2020
Jul 18, 2023
Jul 18, 2023
Dec 9, 2018

Repository files navigation

Merge multiple PHPUnit reports into one file

Latest Stable Version StyleCI

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 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.

$ vendor/bin/phpunit-merger log <directory> <file>

Arguments

  • directory: Provides the directory containing one or multiple files in JUnit XML format
  • file: File where the merged result should be stored

About

Merge multiple PHPUnit reports into one file

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%