"Web界面"到PHPUnit测试? [英] "Web interface" to PHPUnit tests?

查看:101
本文介绍了"Web界面"到PHPUnit测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行PHPUnit测试套件是否有简单的"Web界面"?即一个PHP脚本,该脚本在命令行上运行测试,并输出格式正确的HTML结果.

Is there a simple "Web interface" to running PHPUnit test suites? i.e. a PHP script that runs the test on the command line, and outputs a nicely formatted HTML result.

我开发Web应用程序,并且日常工作流程通常在IDE和浏览器之间切换.我想在同一环境中进行单元测试.

I develop web applications, and the day-to-day workflow usually switches between the IDE and the browser. I would like to have the unit testing in the same environment.

我正在寻找一些非常简单且基于PHP的东西-我正计划进入phpUnderControl(具有我正在寻找的功能),但还没有.

I'm looking for something really simple and PHP based - I am planning to get into phpUnderControl (which has the functionality I'm looking for) but not yet.

推荐答案

您可以使用phing运行 PHPUnitTask ,然后将输出转换为:

You can use phing to run a PHPUnitTask and then convert the output with:

  • PHPUnitReport -此任务使用以下命令将PHPUnit xml报告转换为HTML XSLT.
  • PHPUnitReport - This task transforms PHPUnit xml reports to HTML using XSLT.

示例:

<phpunitreport infile="reports/testsuites.xml" 
    format="frames" 
    todir="reports/tests" 
    styledir="/home/phing/etc"/>

有关各种输出格式,请参见phpunit --help.

See phpunit --help for the various output formats.

PHPUnit的2.3版本对此进行了介绍,但现在已经消失了一段时间.您也许可以在某个地方找到Google的旧副本.

The 2.3 version of PHPUnit had a chapter on this, but it is gone for some time now. You might be able to find an old copy with Google somewhere.

由于您提到的是针对phpUnderControl的:如果您对此不满意,请考虑使用Jenkins和 http://jenkins -php.org .

Since you mention this is for phpUnderControl: if you are not fixed on that, consider using Jenkins and http://jenkins-php.org.

附带说明:除非我们使用的是CI服务器,否则我认识的大多数人都不会通过Web界面使用PHPUnit.他们要么使用命令行,要么使用IDE集成.

On a side note: unless we are talking CI servers, most people I know don't use PHPUnit through a web interface. They either just use the command line or their IDE integration.

这篇关于"Web界面"到PHPUnit测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆