diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.htaccess | 15 | ||||
-rw-r--r-- | tests/plugins/PluginMarkdownTest.php | 29 |
2 files changed, 38 insertions, 6 deletions
diff --git a/tests/.htaccess b/tests/.htaccess index b584d98c..f601c1ee 100644 --- a/tests/.htaccess +++ b/tests/.htaccess | |||
@@ -1,2 +1,13 @@ | |||
1 | Allow from none | 1 | <IfModule version_module> |
2 | Deny from all | 2 | <IfVersion >= 2.4> |
3 | Require all denied | ||
4 | </IfVersion> | ||
5 | <IfVersion < 2.4> | ||
6 | Allow from none | ||
7 | Deny from all | ||
8 | </IfVersion> | ||
9 | </IfModule> | ||
10 | |||
11 | <IfModule !version_module> | ||
12 | Require all denied | ||
13 | </IfModule> | ||
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() |