【发布时间】:2016-03-05 17:19:09
【问题描述】:
我正在编写与 PHPUnit 一起使用的自定义断言,但每当我放置自定义断言时,我都会看到两 (2) 条错误消息。
代码:
$this->_testCase->assertThat(
$hasMessageCode,
$this->_testCase->isTrue(),
"Failed asserting that API response contains a message whose code is {$code}."
);
输出:
1) ApiTest::testFoo
Failed asserting that API response contains an error whose code is REG012.
Failed asserting that false is true.
有什么办法可以只输出 custom 消息而跳过第二条?
【问题讨论】: