我最近更新了Sebastian Bergmann的PHPUnit,当我尝试运行测试用例时,我将其作为输出:
...EEE.EEEEE.E.EE............EFFFE.F..FF.........SSSSSSSSSSSSSS 63 / 110 ( 57%)
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS....W.W 110 / 110 (100%)
根据文档,我可以找到:
. Success
E Error
F Failed
我不确定W
和S
这里是什么。谁能告诉我那是什么?如果其他信息有帮助,则W
为黄色,S
为蓝色。
答案 0 :(得分:11)
根据Docs:
. 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).
根据Source Code:
public function addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_Warning $e, $time)
{
$this->writeProgressWithColor('fg-yellow, bold', 'W');
$this->lastTestFailed = true;
}
黄色粗体W
用于警告。希望这能回答你的问题。
答案 1 :(得分:1)
根据documentation,S
代表 S kipped测试(即,由注释标记的测试意味着它们不应运行)。
答案 2 :(得分:0)
S意味着跳过,请看这里:https://phpunit.de/manual/current/en/phpunit-book.html#textui不确定W的意思,也许是“警告”?
答案 3 :(得分:0)
其他答案正在描述除W
以外的所有参数。如果您使用的是Laravel,并且看到此粗体黄色W
,则会测试哪个文件名与内部的类名不匹配。您需要使用--debug
在一边运行所有测试。首先,您看到W
显示有问题的类:
phpunit tests/ --debug