public function ClassMetadataFactoryTest::testMergeParentConstraints

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php, line 37

Class

ClassMetadataFactoryTest

Namespace

Symfony\Component\Validator\Tests\Mapping

Code

public function testMergeParentConstraints() {
  $factory = new ClassMetadataFactory(new TestLoader());
  $metadata = $factory
    ->getMetadataFor(self::CLASSNAME);
  $constraints = array(
    new ConstraintA(array(
      'groups' => array(
        'Default',
        'EntityParent',
        'Entity',
      ),
    )),
    new ConstraintA(array(
      'groups' => array(
        'Default',
        'EntityInterface',
        'Entity',
      ),
    )),
    new ConstraintA(array(
      'groups' => array(
        'Default',
        'Entity',
      ),
    )),
  );
  $this
    ->assertEquals($constraints, $metadata
    ->getConstraints());
}