public function AbstractReaderTest::testImportWithInheritance

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/AbstractReaderTest.php, line 258

Class

AbstractReaderTest

Namespace

Doctrine\Tests\Common\Annotations

Code

public function testImportWithInheritance() {
  $reader = $this
    ->getReader();
  $class = new TestParentClass();
  $ref = new \ReflectionClass($class);
  $childAnnotations = $reader
    ->getPropertyAnnotations($ref
    ->getProperty('child'));
  $this
    ->assertEquals(1, count($childAnnotations));
  $this
    ->assertInstanceOf('Doctrine\\Tests\\Common\\Annotations\\Foo\\Name', reset($childAnnotations));
  $parentAnnotations = $reader
    ->getPropertyAnnotations($ref
    ->getProperty('parent'));
  $this
    ->assertEquals(1, count($parentAnnotations));
  $this
    ->assertInstanceOf('Doctrine\\Tests\\Common\\Annotations\\Bar\\Name', reset($parentAnnotations));
}