{"id":19882243,"url":"https://github.com/codeclimate/php-test-reporter","last_synced_at":"2025-04-06T00:09:16.118Z","repository":{"id":16108626,"uuid":"18853682","full_name":"codeclimate/php-test-reporter","owner":"codeclimate","description":"DEPRECATED PHP Test Reporter","archived":false,"fork":false,"pushed_at":"2020-11-30T06:31:22.000Z","size":275,"stargazers_count":65,"open_issues_count":6,"forks_count":34,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-04-14T09:40:02.357Z","etag":null,"topics":["ci","code-generation","codeclimate","continuous-integration","coverage-data","coverage-report","php","quality","test-coverage"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"barryclark/jekyll-now","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeclimate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-16T19:57:50.000Z","updated_at":"2022-03-22T21:41:52.000Z","dependencies_parsed_at":"2022-09-19T10:50:18.887Z","dependency_job_id":null,"html_url":"https://github.com/codeclimate/php-test-reporter","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Fphp-test-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Fphp-test-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Fphp-test-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeclimate%2Fphp-test-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeclimate","download_url":"https://codeload.github.com/codeclimate/php-test-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","code-generation","codeclimate","continuous-integration","coverage-data","coverage-report","php","quality","test-coverage"],"created_at":"2024-11-12T17:16:54.042Z","updated_at":"2025-04-06T00:09:16.085Z","avatar_url":"https://github.com/codeclimate.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/codeclimate/php-test-reporter.svg?branch=master)](https://travis-ci.org/codeclimate/php-test-reporter)\n[![Code Climate](https://codeclimate.com/github/codeclimate/php-test-reporter.svg)](https://codeclimate.com/github/codeclimate/php-test-reporter)\n[![Test Coverage](https://codeclimate.com/github/codeclimate/php-test-reporter/badges/coverage.svg)](https://codeclimate.com/github/codeclimate/php-test-reporter/coverage)\n\n# codeclimate-test-reporter - [DEPRECATED]\n\nThese 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.\n\nCollects test coverage data from your PHP test suite and sends it to\nCode Climate's hosted, automated code review service.\n\nCode Climate - https://codeclimate.com\n\n**Important:** If you encounter an error involving SSL certificates, see the **Known Issue: SSL Certificate Error** section below.\n\n# Important FYIs\n\nAcross 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:\n\n* **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.\n\n  **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.\n\n  **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.\n* **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.\n\n## Requirements\n\nThere are several requirements you'll need in order to use the PHP test reporter on your system:\n\n- [PHPUnit](http://phpunit.de)\n- [Xdebug](http://xdebug.org)\n- [Composer](http://getcomposer.org)\n\nThe 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.\n\nXdebug 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).\n\nIf 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:\n\n```\nPHP 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\n```\n\n## Installation\n\nThis package requires a user, but not necessarily a paid account, on\nCode Climate, so if you don't have one the first step is to signup at:\nhttps://codeclimate.com.\n\n### Via composer\n\nTo install php-test-reporter with Composer run the following command.\n\n```shell\n$ composer require codeclimate/php-test-reporter --dev\n```\n\nThis 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:\n\n```shell\n$ composer require codeclimate/php-test-reporter:@dev --dev\n```\n\n### As PHAR tool\n\nCheckout the [latest release here](https://github.com/codeclimate/php-test-reporter/releases) and replace `X.X.X` with the latest version.\n\n```shell\n$ RELEASE=X.X.X\n$ wget -c \"https://github.com/codeclimate/php-test-reporter/releases/download/$RELEASE/codeclimate-test-reporter.phar\"\n```\n\n## Usage\n\n- Generate coverage data to `build/logs/clover.xml`\n\nAdd the following to phpunit.xml.dist:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cphpunit ...\u003e\n  \u003clogging\u003e\n    ...\n    \u003clog type=\"coverage-clover\" target=\"build/logs/clover.xml\"/\u003e\n    ...\n  \u003c/logging\u003e\n\u003c/phpunit\u003e\n```\n\nOr invoke `phpunit` as follows:\n\n```shell\n$ phpunit --coverage-clover build/logs/clover.xml\n```\n\n- Specifying your repo token as an environment variable, invoke the\n  test-reporter:\n\n```shell\n$ CODECLIMATE_REPO_TOKEN=\"...\" vendor/bin/test-reporter\n\n# ... or via PHAR ...\n\n$ CODECLIMATE_REPO_TOKEN=\"...\" codeclimate-test-reporter.phar upload\n```\n\nThe `CODECLIMATE_REPO_TOKEN` value is provided after you add your repo\nto your Code Climate account by clicking on \"Setup Test Coverage\" on the\nright hand side of your feed.\n\nPlease contact hello@codeclimate.com if you need any assistance setting\nthis up.\n\n## Troubleshooting\n\nIf 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.\n\n## Known Issue: SSL Certificate Error\n\nIf you encounter an error involving SSL certificates when trying to report\ncoverage data from your CI server, you can work around it by manually posting\nthe data via `curl`:\n\n```yaml\nafter_script:\n  - CODECLIMATE_REPO_TOKEN=\"...\" bin/test-reporter --stdout \u003e codeclimate.json\n  - \"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\"\n```\n\n**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.\n\nMore details can be found in [this issue][issue].\n\n[issue]: https://github.com/codeclimate/php-test-reporter/issues/3\n\n\n## Contributions\n\nPatches, bug fixes, feature requests, and pull requests are welcome on\nthe GitHub page for this project:\n\nhttps://github.com/codeclimate/php-test-reporter\n\nThis package is maintained by Bryan Helmkamp (bryan@codeclimate.com).\n\nFor more details, see [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).\n\n## Copyright\n\nSee LICENSE.txt\n\nPortions of the implementation were inspired by the php-coveralls\nproject.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclimate%2Fphp-test-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeclimate%2Fphp-test-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeclimate%2Fphp-test-reporter/lists"}