2010-01-22 32 views
0

我正在尝试使用PHPUnit,Selenium和Xdebug生成一些测试的html报告。运行测试,如下所示:phpunit xdebug reporting

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

但生成的报告中的信息有点欠缺,它似乎并没有与官方文档here一致。

我刚刚得到一个绿条,“100.00%| 0/0”作为'Lines'列的值。我认为这可能是正常的,但我改变了我的测试脚本故意失败,报告也一样。我会认为它至少会告诉我它失败了。

任何想法为什么会发生这种情况? PS:我正在使用PHPUnit 3.4.8,Xdebug 2.0.5。

+0

脚本的输出是什么?不是报告。 –

+0

我有同样的问题。据一些消息来源,所有你需要做的就是 PHPUnit的--html覆盖./report测试套件 喜欢这个家伙来到这里。这就是我们想要的。 http://jeffreysambells.com/posts/2010/04/08/reporting-code-coverage-with-phpunit-and-xdebug/ 请帮助我们弄清楚如何获取,因为这部分似乎不起作用。 – RiverC

回答

0

@彼得 - 林奎斯特:输出脚本:

$ 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. 
1

代码覆盖率报告告诉你,你的测试覆盖的代码行,独立于他们是否失败与否。报告测试结果并不相同。