<?php
+namespace Shaarli\Plugin\Markdown;
+
use Shaarli\Config\ConfigManager;
+use Shaarli\Plugin\PluginManager;
/**
* PluginMarkdownTest.php
*/
+require_once 'application/bookmark/LinkUtils.php';
require_once 'application/Utils.php';
require_once 'plugins/markdown/markdown.php';
* Class PluginMarkdownTest
* Unit test for the Markdown plugin
*/
-class PluginMarkdownTest extends PHPUnit_Framework_TestCase
+class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
{
/**
* @var ConfigManager instance.
$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().
*/
$this->conf->get('security.markdown_escape', true),
$this->conf->get('security.allowed_protocols')
);
- $this->assertEquals($html, $data);
+ $this->assertEquals($html, $data . PHP_EOL);
}
/**