francis
francis

Reputation: 307

How to export phpunit coverage to xml ( necessary for jenkins reports )

I'm using phpunit and jenkins, the key is that jenkins creates report by using xml files with the results of tests, but I don't know how to export to an xml in phpunit, for now I saw only the option to export in HTML (for coverage).

Upvotes: 1

Views: 987

Answers (1)

qrazi
qrazi

Reputation: 1391

This project from Sebastian Bergmann should give you some pointers. It mentions the following config for PHPUnit...

<logging>
 <log type="coverage-html" target="build/coverage" title="Name of Project"
      charset="UTF-8" yui="true" highlight="true"
      lowUpperBound="35" highLowerBound="70"/>
 <log type="coverage-clover" target="build/logs/clover.xml"/>
 <log type="junit" target="build/logs/junit.xml"
      logIncompleteSkipped="false"/>
</logging>

... so I think you should try --coverage-clover instead of --coverage-html to get an XML-file.

Upvotes: 2

Related Questions