<?php
+namespace Shaarli\Plugin\Markdown;
+
use Shaarli\Config\ConfigManager;
use Shaarli\Plugin\PluginManager;
* Class PluginMarkdownTest
* Unit test for the Markdown plugin
*/
-class PluginMarkdownTest extends PHPUnit_Framework_TestCase
+class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
{
/**
* @var ConfigManager instance.
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);
}
$this->assertEquals($expected, $processedText);
}
+ public function testReverseFeedDirectLink()
+ {
+ $text = 'Description... ';
+ $text .= '— <a href="http://domain.tld/?0oc_VQ" title="Direct link">Direct link</a>';
+ $expected = 'Description... — [Direct link](http://domain.tld/?0oc_VQ)';
+ $processedText = reverse_feed_permalink($text);
+
+ $this->assertEquals($expected, $processedText);
+ }
+
public function testReverseLastFeedPermalink()
{
$text = 'Description... ';