运行 使用 phpunit 测试的输出中的逗号是什么意思?

What does a comma mean in the output from running tests with phpunit?

我有 运行 测试套件的输出 phpunit。我知道句点 (.) 表示通过测试,但逗号 (,) 是什么意思?

16:10:12
PHPUnit 6.1.3 by Sebastian Bergmann and contributors.
..............................F...,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,....,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,E..,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
..........  63 / 145 ( 43%)

如果取字符串

..............................F...,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,....,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,E..,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,...........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
..........

并删除新行,共计 300 个字符。

如果我们删除 ,,它等于 63 个字符,这与 phpunit:

的进度输出匹配
63 / 145

也就是说,正如@Hollings 所建议的,您在某处的测试中反复回显 ,

您可以调整 phpunit.xml 以对风险测试尽可能严格:

<phpunit
    beStrictAboutOutputDuringTests="true"
    verbose="true"    
 >
    <testsuites>
        ...
    </testsuites>
</phpunit>

具体来说,您希望启用此选项

beStrictAboutOutputDuringTests="true"

结合启用的详细信息

verbose="true"

如果您随后 运行 测试,phpunit 将让您知道哪些测试导致输出,例如:

PHPUnit 6.1.3 by Sebastian Bergmann and contributors.

Runtime:    PHP 7.1.5
Configuration:  /Users/am/Sites/Whosebug/45547842/phpunit.xml

R,

Time: 43 ms, Memory: 4.00MB

There was 1 risky test:

1) FooTest::testBar
This test printed output: ,

参考: