How to configure PHPunit test results output to HTML file?
14,117
Build in phpunit you can generate a report in HTML using the --testdox-html <output file>
option. The output is very rudimentary.
Alternatively you can generate the junit xml output using the --log-junit <output file>
option and transform the xml output to html with an xsl-script, e.g. the one from phing (you will need phpunit-noframes.xsl
and str.replace.function.xsl
) using an xsltprocessor like xsltproc. This will give a little bit more information.
For the ultimate power there are frontends for phpunit which displays the test results in the browser as HTML, this could be worth a look as well:
- VisualPHPUnit (resp. at Github)
- PHPUnit_Html
Related videos on Youtube
Author by
Wonky Roger
Updated on June 04, 2022Comments
-
Wonky Roger almost 2 years
I'm using phpunit for testing and I really need html reports in HTML format. Please show me the simplest way or code example.
-
Petr Beneš about 7 yearsVisualPHPUnit docs are really poor. For last few hours I have tried to make it work - no luck.