aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginMarkdownTest.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2019-02-23 16:46:02 +0100
committerVirtualTam <virtualtam@flibidi.net>2019-02-23 16:46:02 +0100
commitaf22c1ae3adb7a0705814bb7c4d75c9e2aa26a0e (patch)
treee461ef309a15e9b9da6058892350c4275558d783 /tests/plugins/PluginMarkdownTest.php
parent1a3da5a5011fc79c2bf15a8d1f6c7dd9f87db715 (diff)
parent1c03b65e2ea722b39e54b22c46014f35e34b575b (diff)
downloadShaarli-af22c1ae3adb7a0705814bb7c4d75c9e2aa26a0e.tar.gz
Shaarli-af22c1ae3adb7a0705814bb7c4d75c9e2aa26a0e.tar.zst
Shaarli-af22c1ae3adb7a0705814bb7c4d75c9e2aa26a0e.zip
Merge tag 'v0.10.3' into latest
Release v0.10.3
Diffstat (limited to 'tests/plugins/PluginMarkdownTest.php')
-rw-r--r--tests/plugins/PluginMarkdownTest.php16
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 /**