19declare(strict_types=1);
25use PHPUnit\Framework\TestCase;
28use PHPUnit\Framework\Attributes\DataProvider;
29use PHPUnit\Framework\MockObject\Stub;
35 protected function setUp(): void
38 $language = $this->createStub(ilLanguage::class);
41 $this->markdown = $group->markdown()->toHTML();
47 [
'lorem',
"<p>lorem</p>\n"],
48 [
'lorem **ipsum**',
"<p>lorem <strong>ipsum</strong></p>\n"],
49 [
'_lorem_ **ipsum**',
"<p><em>lorem</em> <strong>ipsum</strong></p>\n"],
50 [
'# Headline',
"<h1>Headline</h1>\n"],
51 [
'## Headline',
"<h2>Headline</h2>\n"],
52 [
'### Headline',
"<h3>Headline</h3>\n"],
53 [
"1. Lorem\n2. Ipsum",
"<ol>\n<li>Lorem</li>\n<li>Ipsum</li>\n</ol>\n"],
54 [
"- Lorem\n- Ipsum",
"<ul>\n<li>Lorem</li>\n<li>Ipsum</li>\n</ul>\n"],
55 [
'[Link Titel](https://www.ilias.de)',
"<p><a href=\"https://www.ilias.de\">Link Titel</a></p>\n"],
59 #[DataProvider('stringProvider')]
61 string $markdown_string,
62 string $expected_html,
64 $this->assertEquals($expected_html, $this->markdown->
transform($markdown_string));