diff --git a/tests/datasets/content/text/markdown/bug-6633.html b/tests/datasets/content/text/markdown/bug-6633.html new file mode 100644 index 000000000..313194e02 --- /dev/null +++ b/tests/datasets/content/text/markdown/bug-6633.html @@ -0,0 +1,9 @@ +
#agroecologia #ecologia #orgânico #agroecology #brazil
diff --git a/tests/datasets/content/text/markdown/bug-6633.md b/tests/datasets/content/text/markdown/bug-6633.md new file mode 100644 index 000000000..330d49167 --- /dev/null +++ b/tests/datasets/content/text/markdown/bug-6633.md @@ -0,0 +1,9 @@ +# Produção de cebola em sistema orgânico com uso de homeopatia + +![Bulbos de cebola em sistema orgânico na fase de colheita +](https://mapadaagroecologia.org/system/midias/imagems/000/000/097/original/Cebola_em_sistema_org%C3%A2nico.jpg?1549640469 "Bulbos de cebola em sistema orgânico na fase de colheita +") + +## https://mapadaagroecologia.org/locais/epagri-estacao-experimental-de-ituporanga-sc?locale=pt-BR + +#agroecologia #ecologia #orgânico #agroecology #brazil \ No newline at end of file diff --git a/tests/src/Content/Text/MarkdownTest.php b/tests/src/Content/Text/MarkdownTest.php new file mode 100644 index 000000000..e39b46b2c --- /dev/null +++ b/tests/src/Content/Text/MarkdownTest.php @@ -0,0 +1,52 @@ +setUpVfsDir(); + $this->mockApp($this->root); + } + + public function dataMarkdown() + { + $inputFiles = glob(__DIR__ . '/../../../datasets/content/text/markdown/*.md'); + + $data = []; + + foreach ($inputFiles as $file) { + $data[str_replace('.md', '', $file)] = [ + 'input' => file_get_contents($file), + 'expected' => file_get_contents(str_replace('.md', '.html', $file)) + ]; + } + + return $data; + } + + /** + * Test convert different input Markdown text into HTML + * @dataProvider dataMarkdown + * + * @param string $input The Markdown text to test + * @param string $expected The expected HTML output + * @throws \Exception + */ + public function testConvert($input, $expected) + { + $output = Markdown::convert($input); + + $this->assertEquals($expected, $output); + } +} \ No newline at end of file