assertSame($docComment, $reconstitutedDocComment); } /** * Method * * Method which contains a modulo sign (%) in its description. * * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter * * @covers ::__construct * @covers ::render * @covers ::__toString */ public function testDescriptionCanContainPercent(): void { $factory = DocBlockFactory::createInstance(); $contextFactory = new ContextFactory(); $method = new \ReflectionMethod(self::class, 'testDescriptionCanContainPercent'); $docblock = $factory->create( $method, $contextFactory->createFromReflector($method->getDeclaringClass()) ); $tag1 = new Generic('JoinColumn', new Description('(name="column_id", referencedColumnName="id")')); $tag2 = new Generic('JoinColumn', new Description('(name="column_id_2", referencedColumnName="id")')); $tags = [ $tag1, $tag2, ]; $fixture = $docblock->getDescription(); $expected = 'Method which contains a modulo sign (%) in its description.'; $this->assertSame($expected, (string) $fixture); } }