aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-12-29 11:59:14 +0100
committerArthurHoaro <arthur@hoa.ro>2020-12-29 11:59:14 +0100
commit035a002edc7376a961e5621dc1039b082637fbc6 (patch)
tree7160dbf2ff8f699d4dc818492676aa7cc02043f3 /tests/plugins
parentf2e309b67d92ea19e47f1fc6b9a676c19d8cf33d (diff)
downloadShaarli-035a002edc7376a961e5621dc1039b082637fbc6.tar.gz
Shaarli-035a002edc7376a961e5621dc1039b082637fbc6.tar.zst
Shaarli-035a002edc7376a961e5621dc1039b082637fbc6.zip
Fix default_colors plugin: update CSS file on color change
Last update of this plugin remove the save_plugin_parameters hook. Fixes #1657
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/PluginDefaultColorsTest.php23
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}