Generates a cobertura code coverage report from phpunit

0.1.1 2020-09-03 14:15 UTC

This package is auto-updated.

Last update: 2024-01-29 03:42:53 UTC


Latest Version on Packagist GitHub Workflow Status Total Downloads

Some modern workflows need test coverage report to be generated with Cobertura. Phpunit does not support (yet ?) Cobertura report generation.

This project aims to solve this.


Via composer :

composer require --dev soyhuce/phpunit-to-cobertura

That's all !

Generating a Cobertura coverage report

First, you need to run your phpunit tests with code coverage enabled. This needs to generate (at least) the code coverage in php format.

<coverage processUncoveredFiles="true">
        <directory suffix=".php">src</directory>
        <php outputFile="./phpunit/codeCoverage.php"/>

Once done, you can convert the php code coverage into a Cobertura coverage.

./vendor/bin/phpunit-to-cobertura ./phpunit/codeCoverage.php ./phpunit/coberturaCoverage.xml


Fow now, only PHPUnit 9.3 is supported.


You are welcome to contribute to this project ! Please see


This package is provided under the MIT License