mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-67364 output: Add unit testing for editor_scss_to_css
This commit is contained in:
parent
1c10c542f3
commit
2c78a8f479
@ -175,4 +175,42 @@ class core_theme_config_testcase extends advanced_testcase {
|
||||
|
||||
$this->assertRegExp("/{$themerevision}_{$themesubrevision}/", $url->out(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm that editor_scss_to_css is correctly compiling for themes with no parent.
|
||||
*/
|
||||
public function test_editor_scss_to_css_root_theme() {
|
||||
global $CFG;
|
||||
|
||||
$this->resetAfterTest();
|
||||
$theme = theme_config::load('boost');
|
||||
$editorscss = $CFG->dirroot.'/theme/boost/scss/editor.scss';
|
||||
|
||||
$this->assertTrue(file_exists($editorscss));
|
||||
$compiler = new core_scss();
|
||||
$compiler->set_file($editorscss);
|
||||
$cssexpected = $compiler->to_css();
|
||||
$cssactual = $theme->editor_scss_to_css();
|
||||
|
||||
$this->assertEquals($cssexpected, $cssactual);
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm that editor_scss_to_css is compiling for a child theme not overriding its parent's editor SCSS.
|
||||
*/
|
||||
public function test_editor_scss_to_css_child_theme() {
|
||||
global $CFG;
|
||||
|
||||
$this->resetAfterTest();
|
||||
$theme = theme_config::load('classic');
|
||||
$editorscss = $CFG->dirroot.'/theme/boost/scss/editor.scss';
|
||||
|
||||
$this->assertTrue(file_exists($editorscss));
|
||||
$compiler = new core_scss();
|
||||
$compiler->set_file($editorscss);
|
||||
$cssexpected = $compiler->to_css();
|
||||
$cssactual = $theme->editor_scss_to_css();
|
||||
|
||||
$this->assertEquals($cssexpected, $cssactual);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user