Skip to content

Commit f179bd0

Browse files
author
Alexander Obuhovich
committed
Getting warning about 0 array index instead of annotation exception
1 parent 07f56e2 commit f179bd0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

test/suite/Annotations.case.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ class TypeAwareAnnotation extends VarAnnotation
117117
class 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
/**

test/suite/Annotations.test.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)