diff options
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/PluginMarkdownTest.php | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php index 12bdda24..17ef2280 100644 --- a/tests/plugins/PluginMarkdownTest.php +++ b/tests/plugins/PluginMarkdownTest.php | |||
@@ -8,8 +8,8 @@ require_once 'application/Utils.php'; | |||
8 | require_once 'plugins/markdown/markdown.php'; | 8 | require_once 'plugins/markdown/markdown.php'; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Class PlugQrcodeTest | 11 | * Class PluginMarkdownTest |
12 | * Unit test for the QR-Code plugin | 12 | * Unit test for the Markdown plugin |
13 | */ | 13 | */ |
14 | class PluginMarkdownTest extends PHPUnit_Framework_TestCase | 14 | class PluginMarkdownTest extends PHPUnit_Framework_TestCase |
15 | { | 15 | { |
@@ -130,8 +130,11 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase | |||
130 | )) | 130 | )) |
131 | ); | 131 | ); |
132 | 132 | ||
133 | $data = hook_markdown_render_linklist($data); | 133 | $processed = hook_markdown_render_linklist($data); |
134 | $this->assertEquals($str, $data['links'][0]['description']); | 134 | $this->assertEquals($str, $processed['links'][0]['description']); |
135 | |||
136 | $processed = hook_markdown_render_feed($data); | ||
137 | $this->assertEquals($str, $processed['links'][0]['description']); | ||
135 | 138 | ||
136 | $data = array( | 139 | $data = array( |
137 | // Columns data | 140 | // Columns data |
@@ -153,6 +156,24 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase | |||
153 | } | 156 | } |
154 | 157 | ||
155 | /** | 158 | /** |
159 | * Test that a close value to nomarkdown is not understand as nomarkdown (previous value `.nomarkdown`). | ||
160 | */ | ||
161 | function testNoMarkdownNotExcactlyMatching() | ||
162 | { | ||
163 | $str = 'All _work_ and `no play` makes Jack a *dull* boy.'; | ||
164 | $data = array( | ||
165 | 'links' => array(array( | ||
166 | 'description' => $str, | ||
167 | 'tags' => '.' . NO_MD_TAG, | ||
168 | 'taglist' => array('.'. NO_MD_TAG), | ||
169 | )) | ||
170 | ); | ||
171 | |||
172 | $data = hook_markdown_render_feed($data); | ||
173 | $this->assertContains('<em>', $data['links'][0]['description']); | ||
174 | } | ||
175 | |||
176 | /** | ||
156 | * Test hashtag links processed with markdown. | 177 | * Test hashtag links processed with markdown. |
157 | */ | 178 | */ |
158 | function testMarkdownHashtagLinks() | 179 | function testMarkdownHashtagLinks() |