File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,16 @@ class TypeAwareAnnotation extends VarAnnotation
117117class NoUsageAnnotation
118118{
119119
120+ }
121+
122+ /**
123+ * @usage('class'=>true)
124+ * @usage('method'=>true)
125+ */
126+ class MultiUsageAnnotation extends Annotation
127+ {
128+
129+
120130}
121131
122132/**
Original file line number Diff line number Diff line change @@ -225,6 +225,16 @@ protected function testUsageAnnotationIsInherited()
225225 $ this ->check ($ usage ->method === true );
226226 }
227227
228+ public function testAnnotationWithMultipleUsageAnnotations ()
229+ {
230+ $ this ->setExpectedException (
231+ self ::ANNOTATION_EXCEPTION ,
232+ "the class 'MultiUsageAnnotation' must have exactly one UsageAnnotation (no other Annotations are allowed) "
233+ );
234+
235+ Annotations::getUsage ('MultiUsageAnnotation ' );
236+ }
237+
228238 protected function testGetUsageOfUndefinedAnnotationClass ()
229239 {
230240 $ this ->setExpectedException (
You can’t perform that action at this time.
0 commit comments