我正在编写一个与PHPUnit一起使用的自定义断言,但每当我放置一个自定义断言时,我都会看到两(2)条错误消息.
代码:
$this->_testCase->assertThat(
$hasMessageCode,
$this->_testCase->isTrue(),
"Failed asserting that API response contains a message whose code is {$code}."
);
Run Code Online (Sandbox Code Playgroud)
输出:
1) ApiTest::testFoo
Failed asserting that API response contains an error whose code is REG012.
Failed asserting that false is true.
Run Code Online (Sandbox Code Playgroud)
有什么办法我只能输出自定义信息并跳过第二个?