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.
精彩评论