3 namespace Friendica\Test\src\Content\Text;
5 use Friendica\Content\Text\Markdown;
6 use Friendica\Test\MockedTest;
7 use Friendica\Test\Util\AppMockTrait;
8 use Friendica\Test\Util\VFSTrait;
10 class MarkdownTest extends MockedTest
15 protected function setUp()
19 $this->mockApp($this->root);
22 public function dataMarkdown()
24 $inputFiles = glob(__DIR__ . '/../../../datasets/content/text/markdown/*.md');
28 foreach ($inputFiles as $file) {
29 $data[str_replace('.md', '', $file)] = [
30 'input' => file_get_contents($file),
31 'expected' => file_get_contents(str_replace('.md', '.html', $file))
39 * Test convert different input Markdown text into HTML
40 * @dataProvider dataMarkdown
42 * @param string $input The Markdown text to test
43 * @param string $expected The expected HTML output
46 public function testConvert($input, $expected)
48 $output = Markdown::convert($input);
50 $this->assertEquals($expected, $output);