@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 so, then you need to add to the _class_ doc comment of "Doctrine\Tests\Common\Annotations\Fixtures\NoAnnotation". If it is indeed no annotation, then you need to add @IgnoreAnnotation("NoAnnotation") to the _class_ doc comment of class Doctrine\Tests\Common\Annotations\Fixtures\InvalidAnnotationUsageClass.
public function testErrorWhenInvalidAnnotationIsUsed() {
$reader = $this
->getReader();
$ref = new \ReflectionClass('Doctrine\\Tests\\Common\\Annotations\\Fixtures\\InvalidAnnotationUsageClass');
$reader
->getClassAnnotations($ref);
}