codeclimate/php-test-reporter
PHP Test Reporter submits PHPUnit/PHPSpec code coverage to Code Climate. Generates coverage in CI and posts results to your Code Climate repo, helping track test quality over time. Simple CLI setup for common PHP workflows.
Install the reporter via Composer:
composer require --dev codeclimate/php-test-reporter
(Note: Package is outdated—last release was in 2017—verify compatibility with modern PHP versions before use.)
Generate coverage using PHPUnit (or similar) and output in Clover XML format:
./vendor/bin/phpunit --coverage-clover=coverage.xml
Upload to Code Climate in your CI:
./vendor/bin/test-reporter
Ensure the CODECLIMATE_REPO_TOKEN environment variable is set (found in your Code Climate project settings). The tool auto-detects coverage.xml and uploads.
- name: Upload coverage
run: ./vendor/bin/test-reporter
env:
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
satooshi/php-coveralls) if migration to Code Climate is in progress. Generate Clover from multiple sources (phpunit, pest, custom reporters), merge if needed, then feed to reporter../vendor/bin/test-reporter --file=build/coverage.xml
ReflectionClass::getProperties() behavior changes). Consider alternatives like coveralls or Code Climate’s newer CLI tool (codeclimate-test-reporter) if stability issues arise.CODECLIMATE_REPO_TOKEN and assumes GitHub-style CI job IDs for deduplication. For non-standard CI (e.g., self-hosted runners), manually set CI_BUILD_ID or TRAVIS_BUILD_ID to avoid upload conflicts.0 even if upload fails. Always capture logs in CI (e.g., 2>&1 | tee cc-upload.log) and check Code Climate UI for confirmation.phpunit.xml <coverage> filter support beyond what Clover generates. Ensure your PHPUnit config doesn’t suppress unused branches unless intentionally excluded.--source-files and parallelize uploads (advanced, not officially supported).How can I help you explore Laravel packages today?