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