You are here

public function LazyLoadingMetadataFactoryTest::testMergeParentConstraints in Zircon Profile 8

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

File

vendor/symfony/validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php, line 36

Class

LazyLoadingMetadataFactoryTest

Namespace

Symfony\Component\Validator\Tests\Mapping\Factory

Code

public function testMergeParentConstraints() {
  $factory = new LazyLoadingMetadataFactory(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());
}