diff options
author | yude <yudesleepy@gmail.com> | 2021-01-04 18:51:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 18:51:10 +0900 |
commit | e6754f2154a79abd8e5e64bd923f6984aa9ad44b (patch) | |
tree | f074119530bb59ef155938ea367f719f1e4b70f1 /tests/plugins/PluginDefaultColorsTest.php | |
parent | 5256b4287021342a9f8868967b2a77e481314331 (diff) | |
parent | ed4ee8f0297941ac83300389b7de6a293312d20e (diff) | |
download | Shaarli-e6754f2154a79abd8e5e64bd923f6984aa9ad44b.tar.gz Shaarli-e6754f2154a79abd8e5e64bd923f6984aa9ad44b.tar.zst Shaarli-e6754f2154a79abd8e5e64bd923f6984aa9ad44b.zip |
Merge pull request #2 from shaarli/master
Merge fork source
Diffstat (limited to 'tests/plugins/PluginDefaultColorsTest.php')
-rw-r--r-- | tests/plugins/PluginDefaultColorsTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/plugins/PluginDefaultColorsTest.php b/tests/plugins/PluginDefaultColorsTest.php index cc844c60..54e97612 100644 --- a/tests/plugins/PluginDefaultColorsTest.php +++ b/tests/plugins/PluginDefaultColorsTest.php | |||
@@ -193,4 +193,27 @@ class PluginDefaultColorsTest extends TestCase | |||
193 | $result = default_colors_format_css_rule($data, ''); | 193 | $result = default_colors_format_css_rule($data, ''); |
194 | $this->assertEmpty($result); | 194 | $this->assertEmpty($result); |
195 | } | 195 | } |
196 | |||
197 | /** | ||
198 | * Make sure that a new CSS file is generated when save_plugin_parameters hook is triggered. | ||
199 | */ | ||
200 | public function testHookSavePluginParameters(): void | ||
201 | { | ||
202 | $params = [ | ||
203 | 'other1' => true, | ||
204 | 'DEFAULT_COLORS_BACKGROUND' => 'pink', | ||
205 | 'other2' => ['yep'], | ||
206 | 'DEFAULT_COLORS_DARK_MAIN' => '', | ||
207 | ]; | ||
208 | |||
209 | hook_default_colors_save_plugin_parameters($params); | ||
210 | $this->assertFileExists($file = 'sandbox/default_colors/default_colors.css'); | ||
211 | $content = file_get_contents($file); | ||
212 | $expected = ':root { | ||
213 | --background-color: pink; | ||
214 | |||
215 | } | ||
216 | '; | ||
217 | $this->assertEquals($expected, $content); | ||
218 | } | ||
196 | } | 219 | } |