|
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; |
| 20 | +use phpDocumentor\Reflection\Fqsen; |
| 21 | +use phpDocumentor\Reflection\FqsenResolver; |
19 | 22 | use phpDocumentor\Reflection\Types\Context;
|
20 | 23 | use PHPUnit\Framework\TestCase;
|
21 | 24 |
|
@@ -163,6 +166,60 @@ public function testFactoryMethod() : void
|
163 | 166 | $this->assertSame($description, $fixture->getDescription());
|
164 | 167 | }
|
165 | 168 |
|
| 169 | + /** |
| 170 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public> |
| 171 | + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory |
| 172 | + * @uses \phpDocumentor\Reflection\FqsenResolver |
| 173 | + * @uses \phpDocumentor\Reflection\DocBlock\Description |
| 174 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url |
| 175 | + * @uses \phpDocumentor\Reflection\Types\Context |
| 176 | + * |
| 177 | + * @covers ::create |
| 178 | + */ |
| 179 | + public function testFactoryMethodWithoutSpaceBeforeUrl() : void |
| 180 | + { |
| 181 | + $fqsenResolver = new FqsenResolver(); |
| 182 | + $tagFactory = new StandardTagFactory($fqsenResolver); |
| 183 | + $descriptionFactory = new DescriptionFactory($tagFactory); |
| 184 | + $context = new Context(''); |
| 185 | + |
| 186 | + $fixture = Link::create( |
| 187 | + 'http://this.is.my/link My Description ', |
| 188 | + $descriptionFactory, |
| 189 | + $context |
| 190 | + ); |
| 191 | + |
| 192 | + $this->assertSame('http://this.is.my/link My Description ', (string) $fixture); |
| 193 | + $this->assertSame('My Description ', $fixture->getDescription() . ''); |
| 194 | + } |
| 195 | + |
| 196 | + /** |
| 197 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public> |
| 198 | + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory |
| 199 | + * @uses \phpDocumentor\Reflection\FqsenResolver |
| 200 | + * @uses \phpDocumentor\Reflection\DocBlock\Description |
| 201 | + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url |
| 202 | + * @uses \phpDocumentor\Reflection\Types\Context |
| 203 | + * |
| 204 | + * @covers ::create |
| 205 | + */ |
| 206 | + public function testFactoryMethodWithSpaceBeforeUrl() : void |
| 207 | + { |
| 208 | + $fqsenResolver = new FqsenResolver(); |
| 209 | + $tagFactory = new StandardTagFactory($fqsenResolver); |
| 210 | + $descriptionFactory = new DescriptionFactory($tagFactory); |
| 211 | + $context = new Context(''); |
| 212 | + |
| 213 | + $fixture = Link::create( |
| 214 | + ' http://this.is.my/link My Description ', |
| 215 | + $descriptionFactory, |
| 216 | + $context |
| 217 | + ); |
| 218 | + |
| 219 | + $this->assertSame('http://this.is.my/link My Description ', (string) $fixture); |
| 220 | + $this->assertSame('http://this.is.my/link My Description ', $fixture->getDescription() . ''); |
| 221 | + } |
| 222 | + |
166 | 223 | /**
|
167 | 224 | * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::<public>
|
168 | 225 | * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
|
0 commit comments