public function ElementMetadataTest::testMultipleConstraintsOfTheSameType

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php, line 40

Class

ElementMetadataTest

Namespace

Symfony\Component\Validator\Tests\Mapping

Code

public function testMultipleConstraintsOfTheSameType() {
  $constraint1 = new ConstraintA(array(
    'property1' => 'A',
  ));
  $constraint2 = new ConstraintA(array(
    'property1' => 'B',
  ));
  $this->metadata
    ->addConstraint($constraint1);
  $this->metadata
    ->addConstraint($constraint2);
  $this
    ->assertEquals(array(
    $constraint1,
    $constraint2,
  ), $this->metadata
    ->getConstraints());
}