Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add new test asset.
  • Loading branch information
Sam committed Jul 13, 2017
1 parent 4bd0ae0 commit 3b6be3a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
@@ -0,0 +1,21 @@
<?php

namespace Doctrine\Tests\Common\Reflection;

use Doctrine\Common\Annotations\Annotation;

/**
* @Annotation(
* key = "value"
* )
*/
class AnnotationClassWithScopeResolution {

const foo = \stdClass::class;

/**
* Example with comment.
*/
const bar = \stdClass::class;

}
Expand Up @@ -11,11 +11,4 @@
*/
class ExampleAnnotationClass {

const foo = \stdClass::class;

/**
* Example with comment.
*/
const bar = \stdClass::class;

}
Expand Up @@ -69,12 +69,12 @@ public function parentClassData()
/**
* @dataProvider classAnnotationOptimize
*/
public function testClassAnnotationOptimizedParsing($classAnnotationOptimize) {
public function testClassAnnotationOptimizedParsing($class, $classAnnotationOptimize) {
$testsRoot = substr(__DIR__, 0, -strlen(__NAMESPACE__) - 1);
$paths = [
'Doctrine\\Tests' => [$testsRoot],
];
$staticReflectionParser = new StaticReflectionParser(ExampleAnnotationClass::class, new Psr0FindFile($paths), $classAnnotationOptimize);
$staticReflectionParser = new StaticReflectionParser($class, new Psr0FindFile($paths), $classAnnotationOptimize);
$expectedDocComment = '/**
* @Annotation(
* key = "value"
Expand All @@ -89,8 +89,10 @@ public function testClassAnnotationOptimizedParsing($classAnnotationOptimize) {
public function classAnnotationOptimize()
{
return [
[false],
[true]
[ExampleAnnotationClass::class, false],
[ExampleAnnotationClass::class, true],
[AnnotationClassWithScopeResolution::class, false],
[AnnotationClassWithScopeResolution::class, true],
];
}
}

0 comments on commit 3b6be3a

Please sign in to comment.