1 | <?php |
||
27 | class DocBlockTest extends TestCase |
||
28 | { |
||
29 | /** |
||
30 | * Call Mockery::close after each test. |
||
31 | */ |
||
32 | public function tearDown() : void |
||
33 | { |
||
34 | m::close(); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
39 | * |
||
40 | * @covers ::__construct |
||
41 | * @covers ::getSummary |
||
42 | */ |
||
43 | public function testDocBlockCanHaveASummary() : void |
||
44 | { |
||
45 | $summary = 'This is a summary'; |
||
46 | |||
47 | $fixture = new DocBlock($summary); |
||
48 | |||
49 | $this->assertSame($summary, $fixture->getSummary()); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
54 | * |
||
55 | * @covers ::__construct |
||
56 | * @covers ::getSummary |
||
57 | */ |
||
58 | public function testDocBlockCanHaveEllipsisInSummary() : void |
||
59 | { |
||
60 | $summary = 'This is a short (...) description.'; |
||
61 | |||
62 | $fixture = new DocBlock($summary); |
||
63 | |||
64 | $this->assertSame($summary, $fixture->getSummary()); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
69 | * |
||
70 | * @covers ::__construct |
||
71 | * @covers ::getDescription |
||
72 | */ |
||
73 | public function testDocBlockCanHaveADescription() : void |
||
74 | { |
||
75 | $description = new DocBlock\Description(''); |
||
76 | |||
77 | $fixture = new DocBlock('', $description); |
||
78 | |||
79 | $this->assertSame($description, $fixture->getDescription()); |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
84 | * @uses \phpDocumentor\Reflection\DocBlock\Tag |
||
85 | * |
||
86 | * @covers ::__construct |
||
87 | * @covers ::getTags |
||
88 | */ |
||
89 | public function testDocBlockCanHaveTags() : void |
||
90 | { |
||
91 | $tags = [ |
||
92 | m::mock(DocBlock\Tag::class), |
||
93 | ]; |
||
94 | |||
95 | $fixture = new DocBlock('', null, $tags); |
||
96 | |||
97 | $this->assertSame($tags, $fixture->getTags()); |
||
98 | } |
||
99 | |||
100 | /** |
||
101 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
102 | * @uses \phpDocumentor\Reflection\DocBlock\Tag |
||
103 | * |
||
104 | * @covers ::__construct |
||
105 | * @covers ::getTags |
||
106 | */ |
||
107 | public function testDocBlockAllowsOnlyTags() : void |
||
108 | { |
||
109 | $this->expectException('InvalidArgumentException'); |
||
110 | $tags = [null]; |
||
111 | $fixture = new DocBlock('', null, $tags); |
||
112 | } |
||
113 | |||
114 | /** |
||
115 | * @uses \phpDocumentor\Reflection\DocBlock::getTags |
||
116 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
117 | * @uses \phpDocumentor\Reflection\DocBlock\Tag |
||
118 | * |
||
119 | * @covers ::__construct |
||
120 | * @covers ::getTagsByName |
||
121 | */ |
||
122 | public function testFindTagsInDocBlockByName() : void |
||
138 | |||
139 | /** |
||
140 | * @uses \phpDocumentor\Reflection\DocBlock::getTags |
||
141 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
142 | * @uses \phpDocumentor\Reflection\DocBlock\Tag |
||
143 | * |
||
144 | * @covers ::__construct |
||
145 | * @covers ::hasTag |
||
146 | */ |
||
147 | public function testCheckIfThereAreTagsWithAGivenName() : void |
||
163 | |||
164 | /** |
||
165 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
166 | * @uses \phpDocumentor\Reflection\Types\Context |
||
167 | * |
||
168 | * @covers ::__construct |
||
169 | * @covers ::getContext |
||
170 | */ |
||
171 | public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre() : void |
||
179 | |||
180 | /** |
||
181 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
182 | * @uses \phpDocumentor\Reflection\Location |
||
183 | * |
||
184 | * @covers ::__construct |
||
185 | * @covers ::getLocation |
||
186 | */ |
||
187 | public function testDocBlockKnowsAtWhichLineItIs() : void |
||
195 | |||
196 | /** |
||
197 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
198 | * |
||
199 | * @covers ::__construct |
||
200 | * @covers ::isTemplateStart |
||
201 | * @covers ::isTemplateEnd |
||
202 | */ |
||
203 | public function testDocBlockIsNotATemplateByDefault() : void |
||
210 | |||
211 | /** |
||
212 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
213 | * |
||
214 | * @covers ::__construct |
||
215 | * @covers ::isTemplateStart |
||
216 | */ |
||
217 | public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate() : void |
||
223 | |||
224 | /** |
||
225 | * @uses \phpDocumentor\Reflection\DocBlock\Description |
||
226 | * |
||
227 | * @covers ::__construct |
||
228 | * @covers ::isTemplateEnd |
||
229 | */ |
||
230 | public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate() : void |
||
236 | |||
237 | /** |
||
238 | * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated |
||
239 | * |
||
240 | * @covers ::__construct |
||
241 | * @covers ::removeTag |
||
242 | */ |
||
243 | public function testRemoveTag() : void |
||
260 | } |
||
261 |