mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Fix rendering a description when it contains escaped characters and no tags
This commit is contained in:
@@ -142,4 +142,31 @@ class DescriptionTest extends TestCase
|
||||
. 'inverseJoinColumns={@JoinColumn (name="column_id_2", referencedColumnName="id")})';
|
||||
$this->assertSame($expected, (string) $fixture);
|
||||
}
|
||||
|
||||
/**
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
|
||||
*
|
||||
* @covers ::__construct
|
||||
* @covers ::render
|
||||
* @covers ::__toString
|
||||
*/
|
||||
public function testDescriptionWithEscapedCharactersAndNoTagsCanBeCastToString(): void
|
||||
{
|
||||
//% chars are escaped in \phpDocumentor\Reflection\DocBlock\DescriptionFactory::create
|
||||
$body = <<<'EOT'
|
||||
{%% for user in users %%}
|
||||
{{ user.name }}
|
||||
{%% endfor %%}';
|
||||
EOT;
|
||||
|
||||
$expected = <<<'EOT'
|
||||
{% for user in users %}
|
||||
{{ user.name }}
|
||||
{% endfor %}';
|
||||
EOT;
|
||||
|
||||
$fixture = new Description($body, []);
|
||||
|
||||
$this->assertSame($expected, (string) $fixture);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user