PHPackages                             silantifross/php-test-reporter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. silantifross/php-test-reporter

ActiveLibrary[Testing &amp; Quality](/categories/testing)

silantifross/php-test-reporter
==============================

PHP client for reporting test coverage to Code Climate

v2.0.0(1y ago)03MITPHPPHP ^8.0

Since Dec 20Pushed 1y agoCompare

[ Source](https://github.com/SilantiFross/php-test-reporter)[ Packagist](https://packagist.org/packages/silantifross/php-test-reporter)[ Docs](https://github.com/silantifross/php-test-reporter)[ RSS](/packages/silantifross-php-test-reporter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/d37f9074a1336dea2eda1e9ca3e91eae15b5d2e97d3f0c30595d3249466bf20a/68747470733a2f2f7472617669732d63692e6f72672f636f6465636c696d6174652f7068702d746573742d7265706f727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/codeclimate/php-test-reporter)[![Code Climate](https://camo.githubusercontent.com/2d071fbd24ccb173d05a6583330e21ca980d7d4818e3442b81beda30fef4b049/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f636f6465636c696d6174652f7068702d746573742d7265706f727465722e737667)](https://codeclimate.com/github/codeclimate/php-test-reporter)[![Test Coverage](https://camo.githubusercontent.com/9947d9c7fe67becfdf1bc97d1ed50bcd7c89f305630e1eebaeb75db437650d27/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f636f6465636c696d6174652f7068702d746573742d7265706f727465722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/codeclimate/php-test-reporter/coverage)

codeclimate-test-reporter - php ^8.0
====================================

[](#codeclimate-test-reporter---php-80)

These configuration instructions refer to a language-specific test reporter which is now deprecated in favor of our new unified test reporter client. The [new test reporter](https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage) is faster, distributed as a static binary, has support for parallelized CI builds, and will receive ongoing support by the team here. The existing test reporters for Ruby, Python, PHP, and Javascript are now deprecated.

Collects test coverage data from your PHP test suite and sends it to Code Climate's hosted, automated code review service.

Code Climate -

**Important:** If you encounter an error involving SSL certificates, see the **Known Issue: SSL Certificate Error** section below.

Important FYIs
==============

[](#important-fyis)

Across the many different testing frameworks, setups, and environments, there are lots of variables at play. Before setting up test coverage, it's important to understand what we do and do not currently support:

- **Single payload:** We currently only support a single test coverage payload per commit. If you run your tests in multiple steps, or via parallel tests, Code Climate will only process the first payload that we receive. If you are using a CI, be sure to check if you are running your tests in a parallel mode.

    **Note:** There is one exception to this rule. We've specifically built an integration with [Solano Labs](https://www.solanolabs.com/) to support parallel tests.

    **Note:** If you've configured Code Climate to analyze multiple languages in the same repository (e.g., Ruby and JavaScript), we can nonetheless only process test coverage information for one of these languages. We'll process the first payload that we receive.
- **Invalid File Paths:** By default, our test reporters expect your application to exist at the root of your repository. If this is not the case, the file paths in your test coverage payload will not match the file paths that Code Climate expects.

Requirements
------------

[](#requirements)

There are several requirements you'll need in order to use the PHP test reporter on your system:

- [PHPUnit](http://phpunit.de)
- [Xdebug](http://xdebug.org)
- [Composer](http://getcomposer.org)

The test reporter uses the [PHPUnit](http://phpunit.de) testing tool to generate [code coverage](http://en.wikipedia.org/wiki/Code_coverage) information. These results show how much of your application's code is being executed by your unit tests. PHPUnit can't generate this information on its own though - it needs another tool, [Xdebug](http://xdebug.org). This is *not* included as a part of the PHPUnit (or PHP) install by default so you'll need to install it yourself.

Xdebug is installed as an extension to PHP, not a library. You can find more information about installing the tool via PECL [on the project website](http://xdebug.org/docs/install).

If you execute your PHPUnit tests with the `--coverage-clover` option and receive the message "The Xdebug extension is not loaded. No code coverage will be generated." you will need to visit the Xdebug website and install the extension. If you do not, you'll most likely get an error something like this:

```
PHP Warning:  simplexml_load_file(): I/O warning : failed to load external entity "[...]/build/logs/clover.xml" in [...]/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 52

```

Installation
------------

[](#installation)

This package requires a user, but not necessarily a paid account, on Code Climate, so if you don't have one the first step is to signup at: .

### Via composer

[](#via-composer)

To install php-test-reporter with Composer run the following command.

```
$ composer require codeclimate/php-test-reporter --dev
```

This will get you the latest version of the reporter and install it. If you do want the master, untagged, version you may use the command below:

```
$ composer require codeclimate/php-test-reporter:@dev --dev
```

### As PHAR tool

[](#as-phar-tool)

Checkout the [latest release here](https://github.com/codeclimate/php-test-reporter/releases) and replace `X.X.X` with the latest version.

```
$ RELEASE=X.X.X
$ wget -c "https://github.com/codeclimate/php-test-reporter/releases/download/$RELEASE/codeclimate-test-reporter.phar"
```

Usage
-----

[](#usage)

- Generate coverage data to `build/logs/clover.xml`

Add the following to phpunit.xml.dist:

```

    ...

    ...

```

Or invoke `phpunit` as follows:

```
$ phpunit --coverage-clover build/logs/clover.xml
```

- Specifying your repo token as an environment variable, invoke the test-reporter:

```
$ CODECLIMATE_REPO_TOKEN="..." vendor/bin/test-reporter

# ... or via PHAR ...

$ CODECLIMATE_REPO_TOKEN="..." codeclimate-test-reporter.phar upload
```

The `CODECLIMATE_REPO_TOKEN` value is provided after you add your repo to your Code Climate account by clicking on "Setup Test Coverage" on the right hand side of your feed.

Please contact  if you need any assistance setting this up.

Troubleshooting
---------------

[](#troubleshooting)

If you're having trouble setting up or working with our test coverage feature, [see our detailed help doc](http://docs.codeclimate.com/article/220-help-im-having-trouble-with-test-coverage), which covers the most common issues encountered.

Known Issue: SSL Certificate Error
----------------------------------

[](#known-issue-ssl-certificate-error)

If you encounter an error involving SSL certificates when trying to report coverage data from your CI server, you can work around it by manually posting the data via `curl`:

```
after_script:
  - CODECLIMATE_REPO_TOKEN="..." bin/test-reporter --stdout > codeclimate.json
  - "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
```

**Note:** In the command above, you may need to change `bin/test-reporter` to `vendor/bin/test-reporter`, depending on your project's directory structure.

More details can be found in [this issue](https://github.com/codeclimate/php-test-reporter/issues/3).

Contributions
-------------

[](#contributions)

Patches, bug fixes, feature requests, and pull requests are welcome on the GitHub page for this project:

This package is maintained by Bryan Helmkamp ().

For more details, see [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).

Copyright
---------

[](#copyright)

See LICENSE.txt

Portions of the implementation were inspired by the php-coveralls project.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

505d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6378a10f500eba602712961f6dc21e925aed81bb0b1c20ffa87944cefe95090?d=identicon)[happySisyphus](/maintainers/happySisyphus)

---

Top Contributors

[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (41 commits)")[![pbrisbin](https://avatars.githubusercontent.com/u/50812?v=4)](https://github.com/pbrisbin "pbrisbin (34 commits)")[![maxjacobson](https://avatars.githubusercontent.com/u/1421211?v=4)](https://github.com/maxjacobson "maxjacobson (7 commits)")[![jonathancadepowers](https://avatars.githubusercontent.com/u/6188481?v=4)](https://github.com/jonathancadepowers "jonathancadepowers (6 commits)")[![noahd1](https://avatars.githubusercontent.com/u/11672?v=4)](https://github.com/noahd1 "noahd1 (6 commits)")[![gdiggs](https://avatars.githubusercontent.com/u/245083?v=4)](https://github.com/gdiggs "gdiggs (5 commits)")[![marshally](https://avatars.githubusercontent.com/u/132798?v=4)](https://github.com/marshally "marshally (4 commits)")[![mrb](https://avatars.githubusercontent.com/u/2878?v=4)](https://github.com/mrb "mrb (3 commits)")[![jpignata](https://avatars.githubusercontent.com/u/19775?v=4)](https://github.com/jpignata "jpignata (3 commits)")[![hollodotme](https://avatars.githubusercontent.com/u/1557839?v=4)](https://github.com/hollodotme "hollodotme (3 commits)")[![1ma](https://avatars.githubusercontent.com/u/1456708?v=4)](https://github.com/1ma "1ma (2 commits)")[![aensley](https://avatars.githubusercontent.com/u/95717?v=4)](https://github.com/aensley "aensley (2 commits)")[![davehenton](https://avatars.githubusercontent.com/u/18341459?v=4)](https://github.com/davehenton "davehenton (2 commits)")[![dblandin](https://avatars.githubusercontent.com/u/123595?v=4)](https://github.com/dblandin "dblandin (2 commits)")[![ericdowell](https://avatars.githubusercontent.com/u/525506?v=4)](https://github.com/ericdowell "ericdowell (2 commits)")[![mimmi20](https://avatars.githubusercontent.com/u/1120192?v=4)](https://github.com/mimmi20 "mimmi20 (2 commits)")[![mrrsm](https://avatars.githubusercontent.com/u/1251354?v=4)](https://github.com/mrrsm "mrrsm (2 commits)")[![jeffrafter](https://avatars.githubusercontent.com/u/4064?v=4)](https://github.com/jeffrafter "jeffrafter (1 commits)")[![JacobNinja](https://avatars.githubusercontent.com/u/248220?v=4)](https://github.com/JacobNinja "JacobNinja (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")

---

Tags

coveragecodeclimate

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/silantifross-php-test-reporter/health.svg)

```
[![Health](https://phpackages.com/badges/silantifross-php-test-reporter/health.svg)](https://phpackages.com/packages/silantifross-php-test-reporter)
```

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[php-coveralls/php-coveralls

PHP client library for Coveralls API

51413.7M3.4k](/packages/php-coveralls-php-coveralls)[codeclimate/php-test-reporter

PHP client for reporting test coverage to Code Climate

651.7M1.3k](/packages/codeclimate-php-test-reporter)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[nimut/phpunit-merger

Merge multiple PHPUnit reports into one file

501.7M7](/packages/nimut-phpunit-merger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
