PHPUnit的测试输出中的S和W是什么?

Cod*_*elp 6 php phpunit

我最近更新了Sebastian Bergmann的PHPUnit,当我尝试运行测试用例时,我将其作为输出:

...EEE.EEEEE.E.EE............EFFFE.F..FF.........SSSSSSSSSSSSSS  63 / 110 ( 57%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....W.W                 110 / 110 (100%)
Run Code Online (Sandbox Code Playgroud)

根据文档,我可以发现:

.   Success
E   Error
F   Failed
Run Code Online (Sandbox Code Playgroud)

我不知道什么是WS这里.谁能告诉我那是什么?如果附加信息有帮助,W则为黄色并S为蓝色.

Pra*_*man 13

根据文件:

.   Printed when the test succeeds.
F   Printed when an assertion fails while running the test method.
E   Printed when an error occurs while running the test method.
R   Printed when the test has been marked as risky (see Chapter 6).
S   Printed when the test has been skipped (see Chapter 7).
I   Printed when the test is marked as being incomplete or not yet implemented (see Chapter 7).
Run Code Online (Sandbox Code Playgroud)

并根据源代码:

public function addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time)
{
    $this->writeProgressWithColor('fg-yellow, bold', 'W');
    $this->lastTestFailed = true;
}
Run Code Online (Sandbox Code Playgroud)

黄色大胆的W是警告.希望这能回答你的问题.

  • 也许 PHPunit 在测试开始运行之前在输出的顶部添加一个 LEGEND 是明智的...... (3认同)

swo*_*eta 0

S 表示跳过,请参见此处: https: //phpunit.de/manual/current/en/phpunit-book.html#textui不确定 W 表示什么,也许是“警告”?