You are here

public function AnnotationLoaderTest::testLoadParentClassMetadata in Plug 7

Test MetaData merge with parent annotation.

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/AnnotationLoaderTest.php, line 93

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