]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/PluginMarkdownTest.php
Apply the new system (Bookmark + Service) to the whole code base
[github/shaarli/Shaarli.git] / tests / plugins / PluginMarkdownTest.php
index 5e7c02b0c8f5b95407733d73cf01f95b26ccf3e8..15fa9ba598672d27f46ec989c7c4fd63ccf1c8a7 100644 (file)
@@ -107,7 +107,7 @@ class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
     public function testReverseText2clickable()
     {
         $text = 'stuff http://hello.there/is=someone#here otherstuff';
-        $clickableText = text2clickable($text, '');
+        $clickableText = text2clickable($text);
         $reversedText = reverse_text2clickable($clickableText);
         $this->assertEquals($text, $reversedText);
     }
@@ -156,6 +156,16 @@ class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
         $this->assertEquals($expected, $processedText);
     }
 
+    public function testReverseFeedDirectLink()
+    {
+        $text = 'Description... ';
+        $text .= '&#8212; <a href="http://domain.tld/?0oc_VQ" title="Direct link">Direct link</a>';
+        $expected = 'Description... &#8212; [Direct link](http://domain.tld/?0oc_VQ)';
+        $processedText = reverse_feed_permalink($text);
+
+        $this->assertEquals($expected, $processedText);
+    }
+
     public function testReverseLastFeedPermalink()
     {
         $text = 'Description... ';