Closed nesk closed 5 years ago
@nesk Thank you for the report, I will have a look. In the meantime, PRs are welcome 👍
@nesk I have just tried this agains the current release 0.26.1
and it works as expected?
Here is my test case
<?php
use \PHPUnit\Framework\TestCase;
class CustomAssertMessage extends TestCase
{
/*
* @group xxx
*/
public function test_custom_message()
{
$this->assertEquals(1,2,"This is a test message");
}
}
Output appears as expected
Sorry, just tried to reproduce this in a new and dedicated project, but I can't manage to do it.
This issue is probably on me. 😓
When setting a custom message for an assertion, the printer throws an exception.
Here's an example:
The code fails at this line with the following error:
This is because the
$exceptionMessage
variable contains two directives instead of one, here's the content of the variable with the example above:We have two
%s
directives instead of one, thus thesprintf()
function fails.