diff options
author | VirtualTam <virtualtam@flibidi.net> | 2019-02-23 16:27:33 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2019-02-23 16:27:33 +0100 |
commit | 43c77f658a905e2def6aeca4c092683977cd0c55 (patch) | |
tree | cb0dc273a315a777847d251f856625b2fc779c04 /tests/plugins/PluginMarkdownTest.php | |
parent | 630ebca2b6359e942e5b6c057cca2b6069c1093a (diff) | |
parent | 1826e383ecf501302974132fd443cf1ca06e10f6 (diff) | |
download | Shaarli-43c77f658a905e2def6aeca4c092683977cd0c55.tar.gz Shaarli-43c77f658a905e2def6aeca4c092683977cd0c55.tar.zst Shaarli-43c77f658a905e2def6aeca4c092683977cd0c55.zip |
Merge commit '1826e383ecf501302974132fd443cf1ca06e10f6' into v0.10
Diffstat (limited to 'tests/plugins/PluginMarkdownTest.php')
-rw-r--r-- | tests/plugins/PluginMarkdownTest.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php index b31e817f..44364b05 100644 --- a/tests/plugins/PluginMarkdownTest.php +++ b/tests/plugins/PluginMarkdownTest.php | |||
@@ -47,6 +47,8 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase | |||
47 | $data = hook_markdown_render_linklist($data, $this->conf); | 47 | $data = hook_markdown_render_linklist($data, $this->conf); |
48 | $this->assertNotFalse(strpos($data['links'][0]['description'], '<h1>')); | 48 | $this->assertNotFalse(strpos($data['links'][0]['description'], '<h1>')); |
49 | $this->assertNotFalse(strpos($data['links'][0]['description'], '<p>')); | 49 | $this->assertNotFalse(strpos($data['links'][0]['description'], '<p>')); |
50 | |||
51 | $this->assertEquals($markdown, $data['links'][0]['description_src']); | ||
50 | } | 52 | } |
51 | 53 | ||
52 | /** | 54 | /** |
@@ -107,6 +109,18 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase | |||
107 | } | 109 | } |
108 | 110 | ||
109 | /** | 111 | /** |
112 | * Test reverse_text2clickable(). | ||
113 | */ | ||
114 | public function testReverseText2clickableHashtags() | ||
115 | { | ||
116 | $text = file_get_contents('tests/plugins/resources/hashtags.raw'); | ||
117 | $md = file_get_contents('tests/plugins/resources/hashtags.md'); | ||
118 | $clickableText = hashtag_autolink($text); | ||
119 | $reversedText = reverse_text2clickable($clickableText); | ||
120 | $this->assertEquals($md, $reversedText); | ||
121 | } | ||
122 | |||
123 | /** | ||
110 | * Test reverse_nl2br(). | 124 | * Test reverse_nl2br(). |
111 | */ | 125 | */ |
112 | public function testReverseNl2br() | 126 | public function testReverseNl2br() |
@@ -246,7 +260,7 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase | |||
246 | $this->conf->get('security.markdown_escape', true), | 260 | $this->conf->get('security.markdown_escape', true), |
247 | $this->conf->get('security.allowed_protocols') | 261 | $this->conf->get('security.allowed_protocols') |
248 | ); | 262 | ); |
249 | $this->assertEquals($html, $data); | 263 | $this->assertEquals($html, $data . PHP_EOL); |
250 | } | 264 | } |
251 | 265 | ||
252 | /** | 266 | /** |