mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Fix code style and bump to php 7.4
This commit is contained in:
@@ -14,6 +14,9 @@ declare(strict_types=1);
|
||||
namespace phpDocumentor\Reflection;
|
||||
|
||||
use Mockery as m;
|
||||
use phpDocumentor\Reflection\DocBlock\Description;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Generic;
|
||||
use phpDocumentor\Reflection\Types\ContextFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
@@ -40,4 +43,43 @@ class ReconstitutingADocBlockTest extends TestCase
|
||||
|
||||
$this->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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user