PHP test coverage
SonarQube supports the reporting of test coverage information as part of the analysis of your PHP project.
Adjust your setup
Add coverage to your build process
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug
- name: Install dependencies with composer
run: composer update --no-ansi --no-interaction --no-progress
- name: Run tests with phpunit/phpunit
run: vendor/bin/phpunit --coverage-clover=coverage.xmlAdd the coverage analysis parameter
Coverage parameters can be set in multiple places
Related pages
Last updated
Was this helpful?

