phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

Implementing HTML test log

Open MattiJarvinen-BA opened this issue 14 years ago • 2 comments

I would like to have test results stored as a HTML log (one of the reasons is the fancy coverage report that Sebastian is working on).

Is there an easier way to accomplish HTML test log than by using --log-junit and parsing resulting XML with PHP?

Furthermore what would I have to do except extend PHPUnit_Util_Log_JUnit (to a PHPUnit_Util_Log_HTML and override method flush) and edit TextUI/Command.php to make it a switch into PHPUnit. Or is it just that simple?

MattiJarvinen-BA avatar Sep 18 '12 13:09 MattiJarvinen-BA

I've written something on the subject a whole back http://edorian.posterous.com/creating-your-custom-phpunit-output-formats suggesting to use xslt and the junit output.

If you just want to write something for your own use should be able to do that without the need to change the PHPUnit Code directly.

Without looking into it to deeply i see 4 options:

(Subclassing PHPUnit_Runner_StandardTestSuiteLoader and chaning it in your phpunit.xml)

<phpunit testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"

Apart from that please not that we can't really provide support over the github issue tracker. Please try the irc channel and if you have questions regarding the usage also try IRC or StackOverflow.

Hope that helps and i understood you right :)

edorian avatar Sep 18 '12 13:09 edorian

Thanks got all that I needed.

MattiJarvinen-BA avatar Sep 18 '12 15:09 MattiJarvinen-BA