You are here

public function ConstraintViolationListTest::testAddAll in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/ConstraintViolationListTest.php \Symfony\Component\Validator\Tests\ConstraintViolationListTest::testAddAll()

File

vendor/symfony/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]);
}