|
2 | 2 |
|
3 | 3 | namespace Minime\Annotations; |
4 | 4 |
|
5 | | -use \ReflectionProperty; |
6 | | -use Minime\Annotations\Fixtures\AnnotationsFixture; |
7 | | - |
8 | 5 | /** |
9 | 6 | * ParserTest |
10 | 7 | * |
@@ -40,6 +37,14 @@ public function parseConcreteFixture() |
40 | 37 | '{"foo":"bar","bar":"baz"}', |
41 | 38 | json_encode($annotations['Minime\Annotations\Fixtures\AnnotationConstructInjection'][1]) |
42 | 39 | ); |
| 40 | + $this->assertInstanceOf( |
| 41 | + 'Minime\Annotations\Fixtures\AnnotationConstructSugarInjection', |
| 42 | + $annotations['Minime\Annotations\Fixtures\AnnotationConstructSugarInjection'][0] |
| 43 | + ); |
| 44 | + $this->assertInstanceOf( |
| 45 | + 'Minime\Annotations\Fixtures\AnnotationConstructSugarInjection', |
| 46 | + $annotations['Minime\Annotations\Fixtures\AnnotationConstructSugarInjection'][1] |
| 47 | + ); |
43 | 48 | $this->assertSame( |
44 | 49 | '{"foo":"foo","bar":"bar"}', |
45 | 50 | json_encode($annotations['Minime\Annotations\Fixtures\AnnotationConstructSugarInjection'][0]) |
@@ -173,4 +178,43 @@ public function testTypeRegister() |
173 | 178 | $this->parser->unregisterType('\Minime\Annotations\Fixtures\FooType'); |
174 | 179 | $this->assertSame(['value' => 'foo bar'], $this->parser->parse($docblock)); |
175 | 180 | } |
| 181 | + |
| 182 | + /** |
| 183 | + * @test |
| 184 | + */ |
| 185 | + public function testConcreteTypeNamespaceLookup() |
| 186 | + { |
| 187 | + $this->parser->registerConcreteNamespaceLookup([ |
| 188 | + 'Minime\\Annotations\\Types\\Dummy\\', |
| 189 | + 'Minime\\Annotations\\Fixtures\\' |
| 190 | + ]); |
| 191 | + |
| 192 | + $annotations = $this->getFixture('short_concrete_fixture'); |
| 193 | + |
| 194 | + $this->assertInstanceOf( |
| 195 | + 'Minime\Annotations\Fixtures\AnnotationConstructInjection', |
| 196 | + $annotations['AnnotationConstructInjection'] |
| 197 | + ); |
| 198 | + $this->assertInstanceOf( |
| 199 | + 'Minime\Annotations\Fixtures\AnnotationConstructSugarInjection', |
| 200 | + $annotations['AnnotationConstructSugarInjection'] |
| 201 | + ); |
| 202 | + $this->assertInstanceOf( |
| 203 | + 'Minime\Annotations\Fixtures\AnnotationSetterInjection', |
| 204 | + $annotations['AnnotationSetterInjection'] |
| 205 | + ); |
| 206 | + |
| 207 | + $this->assertSame( |
| 208 | + '{"foo":"bar","bar":"baz"}', |
| 209 | + json_encode($annotations['AnnotationConstructInjection']) |
| 210 | + ); |
| 211 | + $this->assertSame( |
| 212 | + '{"foo":"foo","bar":"bar"}', |
| 213 | + json_encode($annotations['AnnotationConstructSugarInjection']) |
| 214 | + ); |
| 215 | + $this->assertSame( |
| 216 | + '{"foo":"bar"}', |
| 217 | + json_encode($annotations['AnnotationSetterInjection']) |
| 218 | + ); |
| 219 | + } |
176 | 220 | } |
0 commit comments