diff options
Diffstat (limited to 'tests/plugins')
-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 | } |