|
16 | 16 | use Mockery as m;
|
17 | 17 | use phpDocumentor\Reflection\DocBlock\Tags\Deprecated;
|
18 | 18 | use phpDocumentor\Reflection\Types\Context;
|
| 19 | +use phpDocumentor\Reflection\Types\String_; |
19 | 20 | use PHPUnit\Framework\TestCase;
|
20 | 21 |
|
21 | 22 | /**
|
22 | 23 | * @uses \Webmozart\Assert\Assert
|
23 | 24 | *
|
24 |
| - * @coversDefaultClass phpDocumentor\Reflection\DocBlock |
| 25 | + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock |
25 | 26 | * @covers ::<private>
|
26 | 27 | */
|
27 | 28 | class DocBlockTest extends TestCase
|
@@ -138,6 +139,28 @@ public function testFindTagsInDocBlockByName() : void
|
138 | 139 | $this->assertSame([], $fixture->getTagsByName('Ebcd'));
|
139 | 140 | }
|
140 | 141 |
|
| 142 | + /** |
| 143 | + * @uses \phpDocumentor\Reflection\DocBlock::getTags |
| 144 | + * @uses \phpDocumentor\Reflection\DocBlock\Description |
| 145 | + * @uses \phpDocumentor\Reflection\DocBlock\Tag |
| 146 | + * |
| 147 | + * @covers ::__construct |
| 148 | + * @covers ::getTagsWithTypeByName |
| 149 | + */ |
| 150 | + public function testFindTagsWithTypeInDocBlockByName() : void |
| 151 | + { |
| 152 | + $tag1 = new DocBlock\Tags\Var_('foo', new String_()); |
| 153 | + $tag2 = new DocBlock\Tags\Var_('bar', new String_()); |
| 154 | + $tag3 = new DocBlock\Tags\Return_(new String_()); |
| 155 | + $tag4 = new DocBlock\Tags\Author('lall', ''); |
| 156 | + |
| 157 | + $fixture = new DocBlock('', null, [$tag1, $tag2, $tag3, $tag4]); |
| 158 | + |
| 159 | + $this->assertSame([$tag1, $tag2], $fixture->getTagsWithTypeByName('var')); |
| 160 | + $this->assertSame([$tag3], $fixture->getTagsWithTypeByName('return')); |
| 161 | + $this->assertSame([], $fixture->getTagsWithTypeByName('author')); |
| 162 | + } |
| 163 | + |
141 | 164 | /**
|
142 | 165 | * @uses \phpDocumentor\Reflection\DocBlock::getTags
|
143 | 166 | * @uses \phpDocumentor\Reflection\DocBlock\Description
|
|
0 commit comments