class SimpleAnnotationReaderTest

Hierarchy

Expanded class hierarchy of SimpleAnnotationReaderTest

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/SimpleAnnotationReaderTest.php, line 7

Namespace

Doctrine\Tests\Common\Annotations
View source
class SimpleAnnotationReaderTest extends AbstractReaderTest {

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testImportDetectsNotImportedAnnotation() {
    parent::testImportDetectsNotImportedAnnotation();
  }

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testImportDetectsNonExistentAnnotation() {
    parent::testImportDetectsNonExistentAnnotation();
  }

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testClassWithInvalidAnnotationTargetAtClassDocBlock() {
    parent::testClassWithInvalidAnnotationTargetAtClassDocBlock();
  }

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testClassWithInvalidAnnotationTargetAtPropertyDocBlock() {
    parent::testClassWithInvalidAnnotationTargetAtPropertyDocBlock();
  }

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock() {
    parent::testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock();
  }

  /**
   * Contrary to the behavior of the default annotation reader, we do just ignore
   * these in the simple annotation reader (so, no expected exception here).
   */
  public function testClassWithInvalidAnnotationTargetAtMethodDocBlock() {
    parent::testClassWithInvalidAnnotationTargetAtMethodDocBlock();
  }

  /**
   * @expectedException Doctrine\Common\Annotations\AnnotationException
   */
  public function testInvalidAnnotationUsageButIgnoredClass() {
    parent::testInvalidAnnotationUsageButIgnoredClass();
  }

  /**
   * @group DDC-1660
   * @group regression
   *
   * Contrary to the behavior of the default annotation reader, @version is not ignored
   */
  public function testInvalidAnnotationButIgnored() {
    $reader = $this
      ->getReader();
    $class = new \ReflectionClass('Doctrine\\Tests\\Common\\Annotations\\Fixtures\\ClassDDC1660');
    $this
      ->assertTrue(class_exists('Doctrine\\Tests\\Common\\Annotations\\Fixtures\\Annotation\\Version'));
    $this
      ->assertCount(1, $reader
      ->getClassAnnotations($class));
    $this
      ->assertCount(1, $reader
      ->getMethodAnnotations($class
      ->getMethod('bar')));
    $this
      ->assertCount(1, $reader
      ->getPropertyAnnotations($class
      ->getProperty('foo')));
  }
  protected function getReader() {
    $reader = new SimpleAnnotationReader();
    $reader
      ->addNamespace(__NAMESPACE__);
    $reader
      ->addNamespace(__NAMESPACE__ . '\\Fixtures');
    $reader
      ->addNamespace(__NAMESPACE__ . '\\Fixtures\\Annotation');
    return $reader;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractReaderTest::getReflectionClass public function
AbstractReaderTest::testAnnotations public function @dataProvider getReflectionClass
AbstractReaderTest::testAnnotationsWithValidTargets public function
AbstractReaderTest::testAnnotationsWithVarType public function
AbstractReaderTest::testClassSyntaxErrorContext public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in class Doctrine\Tests\Common\Annotations\DummyClassSyntaxError.
AbstractReaderTest::testClassWithAnnotationWithTargetSyntaxErrorAtClassDocBlock public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError.
AbstractReaderTest::testClassWithAnnotationWithTargetSyntaxErrorAtMethodDocBlock public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError.
AbstractReaderTest::testClassWithAnnotationWithTargetSyntaxErrorAtPropertyDocBlock public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 24 in class @Doctrine\Tests\Common\Annotations\Fixtures\AnnotationWithTargetSyntaxError.
AbstractReaderTest::testClassWithMethodInvalidVarTypeError public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage [Type Error] Attribute "annotation" of @AnnotationWithVarType declared on method…
AbstractReaderTest::testClassWithPropertyInvalidVarTypeError public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage [Type Error] Attribute "string" of @AnnotationWithVarType declared on property…
AbstractReaderTest::testErrorWhenInvalidAnnotationIsUsed public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage The class "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation" is not annotated with . Are you sure this class can be used as annotation? If…
AbstractReaderTest::testIgnoresAnnotationsNotPrefixedWithWhitespace public function
AbstractReaderTest::testImportWithConcreteAnnotation public function
AbstractReaderTest::testImportWithInheritance public function
AbstractReaderTest::testMethodSyntaxErrorContext public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in method Doctrine\Tests\Common\Annotations\DummyClassMethodSyntaxError::foo().
AbstractReaderTest::testMultipleAnnotationsOnSameLine public function @group regression
AbstractReaderTest::testNonAnnotationProblem public function
AbstractReaderTest::testPropertySyntaxErrorContext public function @expectedException Doctrine\Common\Annotations\AnnotationException @expectedExceptionMessage Expected namespace separator or identifier, got ')' at position 18 in property Doctrine\Tests\Common\Annotations\DummyClassPropertySyntaxError::$foo.
AbstractReaderTest::testTopLevelAnnotation public function
SimpleAnnotationReaderTest::getReader protected function Overrides AbstractReaderTest::getReader
SimpleAnnotationReaderTest::testClassWithInvalidAnnotationTargetAtClassDocBlock public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testClassWithInvalidAnnotationTargetAtClassDocBlock
SimpleAnnotationReaderTest::testClassWithInvalidAnnotationTargetAtMethodDocBlock public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testClassWithInvalidAnnotationTargetAtMethodDocBlock
SimpleAnnotationReaderTest::testClassWithInvalidAnnotationTargetAtPropertyDocBlock public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testClassWithInvalidAnnotationTargetAtPropertyDocBlock
SimpleAnnotationReaderTest::testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testClassWithInvalidNestedAnnotationTargetAtPropertyDocBlock
SimpleAnnotationReaderTest::testImportDetectsNonExistentAnnotation public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testImportDetectsNonExistentAnnotation
SimpleAnnotationReaderTest::testImportDetectsNotImportedAnnotation public function Contrary to the behavior of the default annotation reader, we do just ignore these in the simple annotation reader (so, no expected exception here). Overrides AbstractReaderTest::testImportDetectsNotImportedAnnotation
SimpleAnnotationReaderTest::testInvalidAnnotationButIgnored public function @group DDC-1660 @group regression Overrides AbstractReaderTest::testInvalidAnnotationButIgnored
SimpleAnnotationReaderTest::testInvalidAnnotationUsageButIgnoredClass public function @expectedException Doctrine\Common\Annotations\AnnotationException Overrides AbstractReaderTest::testInvalidAnnotationUsageButIgnoredClass