+ public function testReverseFeedPermalink()
+ {
+ $text = 'Description... ';
+ $text .= '— <a href="http://domain.tld/?0oc_VQ" title="Permalien">Permalien</a>';
+ $expected = 'Description... — [Permalien](http://domain.tld/?0oc_VQ)';
+ $processedText = reverse_feed_permalink($text);
+
+ $this->assertEquals($expected, $processedText);
+ }
+
+ public function testReverseLastFeedPermalink()
+ {
+ $text = 'Description... ';
+ $text .= '<br>— <a href="http://domain.tld/?0oc_VQ" title="Permalien">Permalien</a>';
+ $expected = $text;
+ $text .= '<br>— <a href="http://domain.tld/?0oc_VQ" title="Permalien">Permalien</a>';
+ $expected .= '<br>— [Permalien](http://domain.tld/?0oc_VQ)';
+ $processedText = reverse_feed_permalink($text);
+
+ $this->assertEquals($expected, $processedText);
+ }
+
+ public function testReverseNoFeedPermalink()
+ {
+ $text = 'Hello! Where are you from?';
+ $expected = $text;
+ $processedText = reverse_feed_permalink($text);
+
+ $this->assertEquals($expected, $processedText);
+ }
+