Skip to content

Commit

Permalink
Improve test error message (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Jul 23, 2024
1 parent 388f5c2 commit ae7fc45
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/Rules/AbstractRuleTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ protected function checkRule(

$id = $violation->getIdentifier()?->toString() ?? '';
if (isset($messages[$id])) {
static::fail(sprintf('Two violations have the same identifier "%s".', $id));
static::fail(sprintf(
'Two violations have the same identifier "%s": the messages are "%s" and "%s".',
$id,
$messages[$id],
$message,
));
}

$messages[$id] = $message;
Expand Down

0 comments on commit ae7fc45

Please sign in to comment.