我正在编写一个自定义的PHPUnit断言,但是每当我放置自定义断言时,我看到两个错误消息。
代码如下:
$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.
有没有办法只输出自定义信息并跳过第二个信息?