How to replace phpunit claim message?
3 answers
As of PHPUnit 6, you must have at least one statement, so I suggest @avolkov's slightly edited answer:
public function assertTrue($condition, $message = '')
{
if (!$condition){
$this->fail($message); //This will cause test fail with your message
}
else{
$this->anything(); //This will eliminate error which says that your test doesn't have assertion
}
}
0
source to share