$assertions =
$this->assertions;
$assertions[] =
$this;
return new self($this->context,
$message,
$this->constraint,
$assertions);
} public function assertRaised(): void
{ $expected =
[];
foreach ($this->assertions
as $assertion) { $expected[] =
$assertion->
getViolation();
} $expected[] =
$this->
getViolation();
$violations =
iterator_to_array($this->context->
getViolations());
Assert::
assertSame($expectedCount = \
count($expected),
$violationsCount = \
count($violations),
sprintf('%u violation(s) expected. Got %u.',
$expectedCount,
$violationsCount));
reset($violations);
foreach ($expected as $violation) { Assert::
assertEquals($violation,
current($violations));