phpunit xdebug 报告

发布于 2024-08-19 00:22:59 字数 449 浏览 6 评论 0原文

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

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

但是生成的报告有些缺乏信息,并且似乎与官方文档不符 此处

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

有什么想法为什么会发生这种情况吗?

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往日情怀 2024-08-26 00:22:59

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

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.

日记撕了你也走了 2024-08-26 00:22:59

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

@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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文