X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fplugins%2FPluginMarkdownTest.php;h=44364b05b5f4a14036e432a51fdc539668ac39dd;hb=e95247d41dbe3b46c83d97f2a9d0e7bd1194bf08;hp=31c1f8b7ff057d9e5c8dba9b77a654fb98ad76f3;hpb=a120fb2977331e0f7d7ffe05861ba179fdae8764;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php index 31c1f8b7..44364b05 100644 --- a/tests/plugins/PluginMarkdownTest.php +++ b/tests/plugins/PluginMarkdownTest.php @@ -108,6 +108,18 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase $this->assertEquals($text, $reversedText); } + /** + * Test reverse_text2clickable(). + */ + public function testReverseText2clickableHashtags() + { + $text = file_get_contents('tests/plugins/resources/hashtags.raw'); + $md = file_get_contents('tests/plugins/resources/hashtags.md'); + $clickableText = hashtag_autolink($text); + $reversedText = reverse_text2clickable($clickableText); + $this->assertEquals($md, $reversedText); + } + /** * Test reverse_nl2br(). */ @@ -248,7 +260,7 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase $this->conf->get('security.markdown_escape', true), $this->conf->get('security.allowed_protocols') ); - $this->assertEquals($html, $data); + $this->assertEquals($html, $data . PHP_EOL); } /**