X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fplugins%2FPluginMarkdownTest.php;h=5e7c02b0c8f5b95407733d73cf01f95b26ccf3e8;hb=9585441734924cb8ece3924afa5fefb6aa2e2604;hp=b31e817fe6093c85e7a5dbb57813a1d6f2ec0ad0;hpb=dd6794cff8a1f26c4d08544d89e1df1f521dcb26;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php index b31e817f..5e7c02b0 100644 --- a/tests/plugins/PluginMarkdownTest.php +++ b/tests/plugins/PluginMarkdownTest.php @@ -1,10 +1,14 @@ conf); $this->assertNotFalse(strpos($data['links'][0]['description'], '

')); $this->assertNotFalse(strpos($data['links'][0]['description'], '

')); + + $this->assertEquals($markdown, $data['links'][0]['description_src']); } /** @@ -106,6 +112,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(). */ @@ -246,7 +264,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); } /**