You are here

public function LegacyElementMetadataTest::testMultipleConstraintsOfTheSameType in Zircon Profile 8

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

File

vendor/symfony/validator/Tests/Mapping/LegacyElementMetadataTest.php, line 43

Class

LegacyElementMetadataTest
@group legacy

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());
}