From 3b4c4d1c2c1b408941aaaa9f1ae4b2d0ff5dc759 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Sat, 24 Oct 2020 02:27:30 +0200 Subject: [PATCH] "CoversTest" -> add only one more test --- tests/unit/DocBlock/Tags/CoversTest.php | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/unit/DocBlock/Tags/CoversTest.php b/tests/unit/DocBlock/Tags/CoversTest.php index 93ece75..a0ebd96 100644 --- a/tests/unit/DocBlock/Tags/CoversTest.php +++ b/tests/unit/DocBlock/Tags/CoversTest.php @@ -16,6 +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\Fqsen; use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\Types\Context; @@ -174,6 +177,35 @@ class CoversTest extends TestCase $this->assertSame('\DateTime', (string) $fixture); } + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See:: + * @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 testFactoryMethodWithSpaceBeforeClass() : void + { + $fqsenResolver = new FqsenResolver(); + $tagFactory = new StandardTagFactory($fqsenResolver); + $descriptionFactory = new DescriptionFactory($tagFactory); + $context = new Context(''); + + $fixture = Covers::create( + 'Foo My Description ', + $descriptionFactory, + $fqsenResolver, + $context + ); + + $this->assertSame('\Foo My Description ', (string) $fixture); + $this->assertSame('\Foo', (string) $fixture->getReference()); + $this->assertSame('My Description ', $fixture->getDescription() . ''); + } + /** * @covers ::__construct * @covers ::__toString