]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/PluginMarkdownTest.php
Merge pull request #1205 from ArthurHoaro/feature/opengraph
[github/shaarli/Shaarli.git] / tests / plugins / PluginMarkdownTest.php
index 31c1f8b7ff057d9e5c8dba9b77a654fb98ad76f3..44364b05b5f4a14036e432a51fdc539668ac39dd 100644 (file)
@@ -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);
     }
 
     /**