【问题标题】:phpunit xdebug reportingphpunit xdebug 报告
【发布时间】:2011-01-08 05:26:32
【问题描述】:

我正在尝试使用 PHPUnit、Selenium 和 Xdebug 生成一些测试的 html 报告。我像这样运行测试:

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

但生成的报告信息有些欠缺,似乎与官方文档here不一致。

我只是得到一个绿色条,其中“100.00% | 0/0”作为“线”列的值。我认为这可能是正常的,但是我故意更改了测试脚本以使其失败,并且报告是相同的。我会假设它至少会告诉我它失败了。

任何想法为什么会发生这种情况?

PS:我使用的是 PHPUnit 3.4.8,Xdebug 2.0.5。

【问题讨论】:

  • 脚本的输出是什么?不是报告。
  • 我也有同样的问题。根据一些消息来源,您所要做的就是 phpunit --html-coverage ./report testsuite 就像这个人来到这里一样。这就是我们想要的。 jeffreysambells.com/posts/2010/04/08/… 请帮助我们弄清楚如何获得它,因为那部分似乎不起作用。

标签: reporting phpunit xdebug


【解决方案1】:

代码覆盖率报告会告诉您测试覆盖的代码行,无论它们是否失败。这与报告测试结果不同。

【讨论】:

    【解决方案2】:

    @peter-lindqvist:脚本输出:

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

    【讨论】:

      猜你喜欢
      • 2012-08-23
      • 2011-11-23
      • 2014-05-12
      • 2020-10-19
      • 2013-06-19
      • 2016-10-24
      • 1970-01-01
      • 2019-04-24
      • 2014-04-16
      相关资源
      最近更新 更多