diff --git a/tests/Helper/ParserTest.php b/tests/Helper/ParserTest.php new file mode 100644 index 0000000..084d6d7 --- /dev/null +++ b/tests/Helper/ParserTest.php @@ -0,0 +1,70 @@ +Some test text

'; + + $this->assertEquals( + "\nSome test text\n\n", + Parser::parseHtml($text), + ); + } + + public function testSimpleNodeWithBold(): void + { + $text = '

Some test text

'; + + $this->assertEquals( + "\nSome \\textbf{test} text\n\n", + Parser::parseHtml($text), + ); + } + + public function testSimpleNodeWithItalic(): void + { + $text = '

Some test text

'; + + $this->assertEquals( + "\nSome \\textit{test} text\n\n", + Parser::parseHtml($text), + ); + } + + public function testDoubleNode(): void + { + $text = '

Some test text

'; + + $this->assertEquals( + "\n\\textbf{Some} \\textit{test} text\n\n", + Parser::parseHtml($text), + ); + } + + public function testDoubleOverlappingNode(): void + { + $text = '

Some test text

'; + + $this->assertEquals( + "\n\\textbf{Some \\textit{test}} text\n\n", + Parser::parseHtml($text), + ); + } + + public function testDoubleEqualNode(): void + { + $text = '

Some test text

'; + + $this->assertEquals( + "\nSome \\textbf{\\textit{test}} text\n\n", + Parser::parseHtml($text), + ); + } +}