I'm using phpunit for testing and I really need html reports in HTML format. Please show me the simplest way or code example.
我正在使用phpunit进行测试,我真的需要HTML格式的HTML报告。请告诉我最简单的方法或代码示例。
1 个解决方案
#1
4
Build in phpunit you can generate a report in HTML using the --testdox-html <output file>
option. The output is very rudimentary.
在phpunit中构建,您可以使用--testdox-html <输出文件> 选项以HTML格式生成报告。输出非常简陋。
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.
或者,您可以使用--log-junit
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:
为了最终的力量,有phpunit的前端,它在浏览器中以HTML显示测试结果,这也值得一看:
- VisualPHPUnit (resp. at Github)
- VisualPHPUnit(分别在Github)
- PHPUnit_Html
- PHPUnit_Html
#1
4
Build in phpunit you can generate a report in HTML using the --testdox-html <output file>
option. The output is very rudimentary.
在phpunit中构建,您可以使用--testdox-html <输出文件> 选项以HTML格式生成报告。输出非常简陋。
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.
或者,您可以使用--log-junit
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:
为了最终的力量,有phpunit的前端,它在浏览器中以HTML显示测试结果,这也值得一看:
- VisualPHPUnit (resp. at Github)
- VisualPHPUnit(分别在Github)
- PHPUnit_Html
- PHPUnit_Html