public function ConstraintViolationListTest::testAddAll

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/ConstraintViolationListTest.php, line 54

Class

ConstraintViolationListTest

Namespace

Symfony\Component\Validator\Tests

Code

public function testAddAll() {
  $violations = array(
    10 => $this
      ->getViolation('Error 1'),
    20 => $this
      ->getViolation('Error 2'),
    30 => $this
      ->getViolation('Error 3'),
  );
  $otherList = new ConstraintViolationList($violations);
  $this->list
    ->addAll($otherList);
  $this
    ->assertCount(3, $this->list);
  $this
    ->assertSame($violations[10], $this->list[0]);
  $this
    ->assertSame($violations[20], $this->list[1]);
  $this
    ->assertSame($violations[30], $this->list[2]);
}