"See" -> add more test + simplify the regex

This commit is contained in:
Lars Moelleken
2020-10-24 10:33:28 +02:00
parent 5a2dd88e14
commit e31c62da4c
2 changed files with 33 additions and 1 deletions
+32
View File
@@ -16,7 +16,9 @@ namespace phpDocumentor\Reflection\DocBlock\Tags;
use Mockery as m;
use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen as FqsenRef;
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen as TagsFqsen;
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Url as UrlRef;
use phpDocumentor\Reflection\Fqsen;
use phpDocumentor\Reflection\FqsenResolver;
@@ -251,6 +253,36 @@ class SeeTest extends TestCase
$this->assertSame($description, $fixture->getDescription());
}
/**
* @uses \phpDocumentor\Reflection\DocBlock\Tags\See::<public>
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
* @uses \phpDocumentor\Reflection\FqsenResolver
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Reference\Url
* @uses \phpDocumentor\Reflection\Types\Context
*
* @covers ::create
*/
public function testFactoryMethodWithoutUrl() : void
{
$fqsenResolver = new FqsenResolver();
$tagFactory = new StandardTagFactory($fqsenResolver);
$descriptionFactory = new DescriptionFactory($tagFactory);
$context = new Context('');
$fixture = See::create(
'Foo My Description ',
$fqsenResolver,
$descriptionFactory,
$context
);
$this->assertSame('\Foo My Description ', (string) $fixture);
$this->assertInstanceOf(TagsFqsen::class, $fixture->getReference());
$this->assertSame('\Foo', (string) $fixture->getReference());
$this->assertSame('My Description ', $fixture->getDescription() . '');
}
/**
* @covers ::create
*/