开发者

phpunit xdebug reporting

开发者 https://www.devze.com 2022-12-17 14:48 出处:网络
I am trying to produce an html report of some tests using PHPUnit, Selenium and Xdebug.I run the test like so:

I am trying to produce an html report of some tests using PHPUnit, Selenium and Xdebug. I run the test like so:

phpunit --coverage-html ./report blah.php

But the report generated is somewhat lacking in information and it doesn't seem to coincide with the official documentation here.

I just get a green bar with "100.00% | 0/0" as the value for the 'Lines' column. I thought perhaps this was normal but I altered my test script to fail deliberately and the report is the same. I 开发者_开发百科would've assumed it would at least tell me that it failed.

Any ideas why this is happening?

PS: I am using PHPUnit 3.4.8, Xdebug 2.0.5.


Code coverage reports tell you the lines of code that your tests covered, independently of whether they failed or not. It is not the same as reporting the tests results.


@peter-lindqvist: Output of script:

$ phpunit --coverage-html ./report blah.php
PHPUnit 3.4.8 by Sebastian Bergmann.

.F

Time: 16 seconds, Memory: 5.50Mb

There was 1 failure:

1) blah::testLocation
Current URL: http://some-url

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-actual_stuff
+expected_stuff

/home/me/..../blah.php:62

FAILURES!
Tests: 2, Assertions: 2, Failures: 1.

Generating code coverage report, this may take a moment.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号