aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Updater
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-02-27 20:24:28 +0100
committerGitHub <noreply@github.com>2017-02-27 20:24:28 +0100
commit5978588578ca103152598ccfbe41019b12e00a4f (patch)
treeeedbb83c420f6af103440bcafbe6b79738ce7521 /tests/Updater
parent9e5a37cc7f4eb1c83222a94eb83d4e99ce4460a4 (diff)
parent7dcbfde5ffbc057a44f710e3be7e4856d235e90b (diff)
downloadShaarli-5978588578ca103152598ccfbe41019b12e00a4f.tar.gz
Shaarli-5978588578ca103152598ccfbe41019b12e00a4f.tar.zst
Shaarli-5978588578ca103152598ccfbe41019b12e00a4f.zip
Merge pull request #754 from ArthurHoaro/webdesign2
New default template
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}