|
17 | 17 | use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
|
18 | 18 | use phpDocumentor\Reflection\DocBlock\Tag;
|
19 | 19 | use phpDocumentor\Reflection\DocBlock\TagFactory;
|
| 20 | +use phpDocumentor\Reflection\DocBlock\Tags\Param; |
20 | 21 | use phpDocumentor\Reflection\Types\Context;
|
21 | 22 |
|
22 | 23 | /**
|
@@ -166,7 +167,7 @@ public function testTagsAreInterpretedUsingFactory()
|
166 | 167 |
|
167 | 168 | $tag = m::mock(Tag::class);
|
168 | 169 | $tagFactory = m::mock(TagFactory::class);
|
169 |
| - $tagFactory->shouldReceive('create')->with($tagString)->andReturn($tag); |
| 170 | + $tagFactory->shouldReceive('create')->with($tagString, m::type(Context::class))->andReturn($tag); |
170 | 171 |
|
171 | 172 | $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory);
|
172 | 173 |
|
@@ -234,4 +235,22 @@ public function provideSummaryAndDescriptions()
|
234 | 235 | ],
|
235 | 236 | ];
|
236 | 237 | }
|
| 238 | + |
| 239 | + /** |
| 240 | + * @covers ::__construct |
| 241 | + * @covers ::create |
| 242 | + * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory |
| 243 | + * @uses phpDocumentor\Reflection\DocBlock\Description |
| 244 | + * @uses phpDocumentor\Reflection\Types\Context |
| 245 | + * @uses phpDocumentor\Reflection\DocBlock\Tags\Param |
| 246 | + */ |
| 247 | + public function testTagsWithContextNamespace() |
| 248 | + { |
| 249 | + $tagFactoryMock = m::mock(TagFactory::class); |
| 250 | + $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), $tagFactoryMock); |
| 251 | + $context = new Context('MyNamespace'); |
| 252 | + |
| 253 | + $tagFactoryMock->shouldReceive('create')->with(m::any(), $context)->andReturn(new Param('param')); |
| 254 | + $docblock = $fixture->create('/** @param MyType $param */', $context); |
| 255 | + } |
237 | 256 | }
|
0 commit comments