Pekka 웃 Pekka 웃 - 1 year ago 131
PHP Question

"Web interface" to PHPUnit tests?

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.

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.

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.

Answer Source

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

  • PHPUnitReport - This task transforms PHPUnit xml reports to HTML using XSLT.


<phpunitreport infile="reports/testsuites.xml" 

See phpunit --help for the various output formats.

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download