Skip to content

Commit 258006f

Browse files
committed
Test it resolves all shortcodes
1 parent ac3ce6e commit 258006f

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

packages/framework/tests/Unit/ColoredBlockquoteShortcodesTest.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,52 @@ public function testWithUnrelatedClass()
7171
);
7272
}
7373

74+
/**
75+
* @dataProvider blockquoteProvider
76+
*/
77+
public function testItResolvesAllShortcodes(string $input, string $expectedOutput)
78+
{
79+
$this->assertSame($expectedOutput, ColoredBlockquotes::resolve($input));
80+
}
81+
82+
public static function blockquoteProvider(): array
83+
{
84+
return [
85+
[
86+
'>danger This is a danger blockquote',
87+
<<<'HTML'
88+
<blockquote class="danger">
89+
<p>This is a danger blockquote</p>
90+
</blockquote>
91+
HTML,
92+
],
93+
[
94+
'>info This is an info blockquote',
95+
<<<'HTML'
96+
<blockquote class="info">
97+
<p>This is an info blockquote</p>
98+
</blockquote>
99+
HTML,
100+
],
101+
[
102+
'>success This is a success blockquote',
103+
<<<'HTML'
104+
<blockquote class="success">
105+
<p>This is a success blockquote</p>
106+
</blockquote>
107+
HTML,
108+
],
109+
[
110+
'>warning This is a warning blockquote',
111+
<<<'HTML'
112+
<blockquote class="warning">
113+
<p>This is a warning blockquote</p>
114+
</blockquote>
115+
HTML,
116+
],
117+
];
118+
}
119+
74120
// Todo: Extract trait for this and MarkdownHeadingRendererUnitTest
75121
protected function createRealBladeCompilerEnvironment(): void
76122
{

0 commit comments

Comments
 (0)