diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Updater/UpdaterTest.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 1d15cfaa..de330ae2 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php | |||
@@ -466,4 +466,44 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; | |||
466 | unlink('sandbox/'. $theme .'/linklist.html'); | 466 | unlink('sandbox/'. $theme .'/linklist.html'); |
467 | rmdir('sandbox/'. $theme); | 467 | rmdir('sandbox/'. $theme); |
468 | } | 468 | } |
469 | |||
470 | /** | ||
471 | * Test updateMethodDefaultThemeVintage with the default theme enabled. | ||
472 | */ | ||
473 | public function testSetDefaultThemeToVintage() | ||
474 | { | ||
475 | $sandboxConf = 'sandbox/config'; | ||
476 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
477 | $this->conf = new ConfigManager($sandboxConf); | ||
478 | |||
479 | $this->conf->set('resource.theme', 'default'); | ||
480 | $updater = new Updater([], [], $this->conf, true); | ||
481 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
482 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
483 | |||
484 | // reload from file | ||
485 | $this->conf = new ConfigManager($sandboxConf); | ||
486 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Test updateMethodDefaultThemeVintage with custom theme enabled => nothing to do. | ||
491 | */ | ||
492 | public function testSetDefaultThemeNothingToDo() | ||
493 | { | ||
494 | $sandboxConf = 'sandbox/config'; | ||
495 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
496 | $this->conf = new ConfigManager($sandboxConf); | ||
497 | |||
498 | $theme = 'myawesometheme'; | ||
499 | $this->conf->set('resource.theme', $theme); | ||
500 | $this->conf->write(true); | ||
501 | $updater = new Updater([], [], $this->conf, true); | ||
502 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
503 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
504 | |||
505 | // reload from file | ||
506 | $this->conf = new ConfigManager($sandboxConf); | ||
507 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
508 | } | ||
469 | } | 509 | } |