Skip to content

Commit aa76b40

Browse files
committed
Improve Markdown document testing
1 parent 51b604a commit aa76b40

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/framework/tests/Unit/MarkdownDocumentTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,30 @@ public function testCarriageReturnsAreNormalized()
108108
$markdown = new Markdown("foo\nbar");
109109
$this->assertSame("foo\nbar", $markdown->body());
110110
}
111+
112+
public function testRender(): void
113+
{
114+
$html = Markdown::render('# Hello World!');
115+
116+
$this->assertIsString($html);
117+
$this->assertSame("<h1>Hello World!</h1>\n", $html);
118+
}
119+
120+
public function testRenderWithCustomHydeMarkdownFeatures()
121+
{
122+
$html = Markdown::render(<<<'MARKDOWN'
123+
# Hello World
124+
125+
>info Colored blockquote
126+
127+
[Home](/_pages/index.blade.php)
128+
MARKDOWN);
129+
130+
$this->assertSame(<<<'HTML'
131+
<h1>Hello World</h1>
132+
<blockquote class="info"><p>Colored blockquote</p></blockquote>
133+
<p><a href="index.html">Home</a></p>
134+
135+
HTML, $html);
136+
}
111137
}

0 commit comments

Comments
 (0)