aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginMarkdownTest.php
diff options
context:
space:
mode:
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 /**