You are here

public function AnnotationLoaderTest::testLoadParentClassMetadata in Zircon Profile 8

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

Test MetaData merge with parent annotation.

File

vendor/symfony/validator/Tests/Mapping/Loader/AnnotationLoaderTest.php, line 83

Class

AnnotationLoaderTest

Namespace

Symfony\Component\Validator\Tests\Mapping\Loader

Code

public function testLoadParentClassMetadata() {
  $loader = new AnnotationLoader(new AnnotationReader());

  // Load Parent MetaData
  $parent_metadata = new ClassMetadata('Symfony\\Component\\Validator\\Tests\\Fixtures\\EntityParent');
  $loader
    ->loadClassMetadata($parent_metadata);
  $expected_parent = new ClassMetadata('Symfony\\Component\\Validator\\Tests\\Fixtures\\EntityParent');
  $expected_parent
    ->addPropertyConstraint('other', new NotNull());
  $expected_parent
    ->getReflectionClass();
  $this
    ->assertEquals($expected_parent, $parent_metadata);
}