You are here

public function StaticReflectionParserTest::testParentClass in Plug 7

@dataProvider parentClassData

Parameters

bool $classAnnotationOptimize:

string $parsedClassName:

string $expectedClassName:

Return value

void

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Reflection/StaticReflectionParserTest.php, line 20

Class

StaticReflectionParserTest

Namespace

Doctrine\Tests\Common\Reflection

Code

public function testParentClass($classAnnotationOptimize, $parsedClassName, $expectedClassName) {

  // If classed annotation optimization is enabled the properties tested
  // below cannot be found.
  if ($classAnnotationOptimize) {
    $this
      ->setExpectedException('ReflectionException');
  }
  $testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1);
  $paths = array(
    'Doctrine\\Tests' => array(
      $testsRoot,
    ),
  );
  $staticReflectionParser = new StaticReflectionParser($parsedClassName, new Psr0FindFile($paths), $classAnnotationOptimize);
  $declaringClassName = $staticReflectionParser
    ->getStaticReflectionParserForDeclaringClass('property', 'test')
    ->getClassName();
  $this
    ->assertEquals($expectedClassName, $declaringClassName);
}