Using Clover for PHP

Clover does not support PHP language. However, there is a PHPUnit framework which can measure code coverage for PHP application and to export coverage data to the Clover's XML report file format.

 

Just use --coverage-clover toggle, for example:

phpunit --log-junit 'reports/unitreport.xml' --coverage-clover 'reports/clover.xml' test/

 

Such XML file can be later used by Bamboo Clover Plugin to display code statistics on a Job Summary page and graphs on a Plan Summary page. In order to achieve this, you have to configure manual Clover integration in Bamboo, pointing to the XML file generated by PHPUnit. See Enabling the Clover add-on for details.

 

There is also a similar plug-in available for Jenkins - see Clover PHP Plugin page.

 

Note: PHPUnit has also an option to produce the HTML report, but this is not a report in Clover's HTML format.

phpunit --log-junit 'reports/unitreport.xml' --coverage-html 'reports/clover_html' test/

 

A report produced by PHPUnit looks like this:

 

 

References