Skip to content

Commit 7ecf3a3

Browse files
committed
Add test for separated and multiple annotations
Separated: #[Test, Values([1, 2, 3])] Multiple: #[Test] #[Values([1, 2, 3])]
1 parent 5d03674 commit 7ecf3a3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/test/php/lang/ast/unittest/emit/AnnotationSupport.class.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,39 @@ public function params() {
153153
}
154154

155155
#[Test]
156-
public function multiple_class_annotations() {
156+
public function separated_class_annotations() {
157157
Assert::equals(
158158
['Resource' => ['/'], 'Authenticated' => []],
159159
$this->annotations($this->declare('#[Resource("/"), Authenticated]'))
160160
);
161161
}
162162

163163
#[Test]
164-
public function multiple_member_annotations() {
164+
public function multiple_class_annotations() {
165+
Assert::equals(
166+
['Resource' => ['/'], 'Authenticated' => []],
167+
$this->annotations($this->declare('#[Resource("/")] #[Authenticated]'))
168+
);
169+
}
170+
171+
#[Test]
172+
public function separated_member_annotations() {
165173
$t= $this->declare('class %T { #[Test, Values([1, 2, 3])] public function fixture() { } }');
166174
Assert::equals(
167175
['Test' => [], 'Values' => [[1, 2, 3]]],
168176
$this->annotations($t->method('fixture'))
169177
);
170178
}
171179

180+
#[Test]
181+
public function multiple_member_annotations() {
182+
$t= $this->declare('class %T { #[Test] #[Values([1, 2, 3])] public function fixture() { } }');
183+
Assert::equals(
184+
['Test' => [], 'Values' => [[1, 2, 3]]],
185+
$this->annotations($t->method('fixture'))
186+
);
187+
}
188+
172189
#[Test]
173190
public function multiline_annotations() {
174191
$annotations= $this->annotations($this->declare('

0 commit comments

Comments
 (0)