You are here

protected function AbstractConstraintValidatorTest::assertViolations in Plug 7

Parameters

array $expected:

Deprecated

To be removed in Symfony 3.0. Use {@link buildViolation()} instead.

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php, line 385

Class

AbstractConstraintValidatorTest
@since 2.5.3

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

protected function assertViolations(array $expected) {
  $violations = $this->context
    ->getViolations();
  $this
    ->assertCount(count($expected), $violations);
  $i = 0;
  foreach ($expected as $violation) {
    $this
      ->assertEquals($violation, $violations[$i++]);
  }
}