Currently I am writing tests for a framework and we usually use a custom error message when a test fails, adding some useful info for debugging:
$this->assertEquals($check, $result,
'Class::method returned the wrong result with argument XXX');
However I'd wish to customize the error message while checking for function invocation:
$mock->expects($this->any())->method('foobar')->with($this->equals('dummy'));
When the above assertion is not true, I get the standard message.
I searched inside PhpUnit documentation, but I can't find a way to customize the error message, am I missing anything?