aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Updater
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-02-27 20:20:53 +0100
committerArthurHoaro <arthur@hoa.ro>2017-02-27 20:20:53 +0100
commit7dcbfde5ffbc057a44f710e3be7e4856d235e90b (patch)
treeeedbb83c420f6af103440bcafbe6b79738ce7521 /tests/Updater
parent7040169069322d72cec4276b7b812291b57a0d40 (diff)
downloadShaarli-7dcbfde5ffbc057a44f710e3be7e4856d235e90b.tar.gz
Shaarli-7dcbfde5ffbc057a44f710e3be7e4856d235e90b.tar.zst
Shaarli-7dcbfde5ffbc057a44f710e3be7e4856d235e90b.zip
Set the vintage theme by default for the time being
Diffstat (limited to 'tests/Updater')
-rw-r--r--tests/Updater/UpdaterTest.php40
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}