diff options
author | Arthur <arthur@hoa.ro> | 2016-12-01 11:13:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 11:13:04 +0100 |
commit | 6781465fda8ad5dc3a37439446d4ff1100f1fd39 (patch) | |
tree | e1d27777f227cb504f418a386fa7397de46cc482 /tests/plugins/PluginMarkdownTest.php | |
parent | 2a543983716e37cf1ea600e7485b0b69cf719053 (diff) | |
parent | 266e3fe5c8961aaf089bad16b9e4c54de1aaff40 (diff) | |
download | Shaarli-6781465fda8ad5dc3a37439446d4ff1100f1fd39.tar.gz Shaarli-6781465fda8ad5dc3a37439446d4ff1100f1fd39.tar.zst Shaarli-6781465fda8ad5dc3a37439446d4ff1100f1fd39.zip |
Merge pull request #691 from ArthurHoaro/plugins/no-md-feed
Markdown: fixes feed rendering with nomarkdown tag
Diffstat (limited to 'tests/plugins/PluginMarkdownTest.php')
-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() |