Skip to content

Commit 6d16b5f

Browse files
committed
Add test for decoding common HTML entities in Blade guidelines
1 parent 4544359 commit 6d16b5f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/Unit/Concerns/RendersBladeGuidelinesTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ public function getStoredSnippets(): array
145145
->not->toContain('"');
146146
});
147147

148+
test('all common html entities are decoded', function (): void {
149+
$this->mock(GuidelineAssist::class);
150+
151+
$content = 'Use {{ "a < b & c > d" }}';
152+
153+
$result = $this->renderer->render($content, '/path/to/guide.blade.php');
154+
155+
expect($result)->toContain('a < b & c > d')
156+
->not->toContain('&lt;')
157+
->not->toContain('&amp;')
158+
->not->toContain('&gt;');
159+
});
160+
148161
test('renderBladeFile returns empty string for non-existent file', function (): void {
149162
$result = $this->renderer->renderFile('/non/existent/guideline.blade.php');
150163

0 commit comments

Comments
 (0)