|
16 | 16 | use Mockery as m;
|
17 | 17 | use phpDocumentor\Reflection\DocBlock\Description;
|
18 | 18 | use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
|
| 19 | +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; |
19 | 20 | use phpDocumentor\Reflection\Fqsen;
|
20 | 21 | use phpDocumentor\Reflection\FqsenResolver;
|
21 | 22 | use phpDocumentor\Reflection\Types\Context;
|
@@ -129,6 +130,12 @@ public function testStringRepresentationIsReturned() : void
|
129 | 130 | */
|
130 | 131 | public function testStringRepresentationIsReturnedWithoutDescription() : void
|
131 | 132 | {
|
| 133 | + $fixture = new Uses(new Fqsen('\\')); |
| 134 | + |
| 135 | + $this->assertSame('\\', (string) $fixture); |
| 136 | + |
| 137 | + // --- |
| 138 | + |
132 | 139 | $fixture = new Uses(new Fqsen('\DateTime'));
|
133 | 140 |
|
134 | 141 | $this->assertSame('\DateTime', (string) $fixture);
|
@@ -170,6 +177,66 @@ public function testFactoryMethod() : void
|
170 | 177 | $this->assertSame($description, $fixture->getDescription());
|
171 | 178 | }
|
172 | 179 |
|
| 180 | + /** |
| 181 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public> |
| 182 | + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory |
| 183 | + * @uses \phpDocumentor\Reflection\FqsenResolver |
| 184 | + * @uses \phpDocumentor\Reflection\DocBlock\Description |
| 185 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url |
| 186 | + * @uses \phpDocumentor\Reflection\Types\Context |
| 187 | + * |
| 188 | + * @covers ::create |
| 189 | + */ |
| 190 | + public function testFactoryMethodWithoutSpaceBeforeClass() : void |
| 191 | + { |
| 192 | + $fqsenResolver = new FqsenResolver(); |
| 193 | + $tagFactory = new StandardTagFactory($fqsenResolver); |
| 194 | + $descriptionFactory = new DescriptionFactory($tagFactory); |
| 195 | + $context = new Context(''); |
| 196 | + |
| 197 | + $fixture = Uses::create( |
| 198 | + 'Foo My Description ', |
| 199 | + $fqsenResolver, |
| 200 | + $descriptionFactory, |
| 201 | + $context |
| 202 | + ); |
| 203 | + |
| 204 | + $this->assertSame('\Foo My Description ', (string) $fixture); |
| 205 | + $this->assertInstanceOf(Fqsen::class, $fixture->getReference()); |
| 206 | + $this->assertSame('\\Foo', (string) $fixture->getReference()); |
| 207 | + $this->assertSame('My Description ', $fixture->getDescription() . ''); |
| 208 | + } |
| 209 | + |
| 210 | + /** |
| 211 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public> |
| 212 | + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory |
| 213 | + * @uses \phpDocumentor\Reflection\FqsenResolver |
| 214 | + * @uses \phpDocumentor\Reflection\DocBlock\Description |
| 215 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url |
| 216 | + * @uses \phpDocumentor\Reflection\Types\Context |
| 217 | + * |
| 218 | + * @covers ::create |
| 219 | + */ |
| 220 | + public function testFactoryMethodWithSpaceBeforeClass() : void |
| 221 | + { |
| 222 | + $fqsenResolver = new FqsenResolver(); |
| 223 | + $tagFactory = new StandardTagFactory($fqsenResolver); |
| 224 | + $descriptionFactory = new DescriptionFactory($tagFactory); |
| 225 | + $context = new Context(''); |
| 226 | + |
| 227 | + $fixture = Uses::create( |
| 228 | + ' Foo My Description ', |
| 229 | + $fqsenResolver, |
| 230 | + $descriptionFactory, |
| 231 | + $context |
| 232 | + ); |
| 233 | + |
| 234 | + $this->assertSame('\ Foo My Description ', (string) $fixture); |
| 235 | + $this->assertInstanceOf(Fqsen::class, $fixture->getReference()); |
| 236 | + $this->assertSame('\\', (string) $fixture->getReference()); |
| 237 | + $this->assertSame('Foo My Description ', $fixture->getDescription() . ''); |
| 238 | + } |
| 239 | + |
173 | 240 | /**
|
174 | 241 | * @covers ::create
|
175 | 242 | */
|
|
0 commit comments