diff --git a/Test/ConstraintValidatorTestCase.php b/Test/ConstraintValidatorTestCase.php index f808e49ba..423c6e0d1 100644 --- a/Test/ConstraintValidatorTestCase.php +++ b/Test/ConstraintValidatorTestCase.php @@ -276,7 +276,9 @@ protected function expectViolationsAt(int $i, mixed $value, Constraint $constrai protected function assertNoViolation() { - $this->assertSame(0, $violationsCount = \count($this->context->getViolations()), sprintf('0 violation expected. Got %u.', $violationsCount)); + $violations = $this->context->getViolations(); + + $this->assertSame(0, $violationsCount = \count($violations), sprintf('0 violation expected. Got %u. Violations: %s', $violationsCount, $violations)); } protected function buildViolation(string|\Stringable $message): ConstraintViolationAssertion