Fix code style and bump to php 7.4

This commit is contained in:
Jaapio
2024-03-12 22:28:53 +01:00
parent 1c6b5465fa
commit c6d49fc451
36 changed files with 181 additions and 137 deletions
@@ -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);
}
}