Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Test Reporter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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

  2. Generate coverage using PHPUnit (or similar) and output in Clover XML format:

    ./vendor/bin/phpunit --coverage-clover=coverage.xml
    
  3. 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.

Implementation Patterns

  • CI Integration (GitHub Actions, GitLab CI, etc.): Add as a final step in test jobs:
    - name: Upload coverage
      run: ./vendor/bin/test-reporter
      env:
        CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
    
  • Hybrid coverage workflows: Use alongside other tools (e.g., 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.
  • Custom paths: Explicitly target non-default coverage files:
    ./vendor/bin/test-reporter --file=build/coverage.xml
    

Gotchas and Tips

  • ⚠️ Outdated & unmaintained: The last commit/release was in 2017. Verify PHP 7.4+ compatibility (especially due to deprecated APIs like ReflectionClass::getProperties() behavior changes). Consider alternatives like coveralls or Code Climate’s newer CLI tool (codeclimate-test-reporter) if stability issues arise.
  • Environment assumptions: Relies on 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.
  • Silent failures: The reporter exits with code 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.
  • Coverage format caveats: Only supports Clover XML—no phpunit.xml <coverage> filter support beyond what Clover generates. Ensure your PHPUnit config doesn’t suppress unused branches unless intentionally excluded.
  • Workaround for large repos: If hitting rate limits or timeouts, split coverage uploads by directory using --source-files and parallelize uploads (advanced, not officially supported).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4