From: ArthurHoaro Date: Wed, 10 May 2017 16:25:56 +0000 (+0200) Subject: Merge pull request #868 from ArthurHoaro/theme/default-as-default X-Git-Tag: v0.9.1~1^2~32 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=61c15aa5554431893ea5ebe800a9a625dca5aff9;hp=3aa7aa0ef0c1351815a827777e752615f5781545;p=github%2Fshaarli%2FShaarli.git Merge pull request #868 from ArthurHoaro/theme/default-as-default Use the new 'default' theme... as default --- diff --git a/application/Updater.php b/application/Updater.php index 03d93a6f..40a15906 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -328,21 +328,6 @@ class Updater return rename('inc/user.css', 'data/user.css'); } - /** - * While the new default theme is in an unstable state - * continue to use the vintage theme - */ - public function updateMethodDefaultThemeVintage() - { - if ($this->conf->get('resource.theme') !== 'default') { - return true; - } - $this->conf->set('resource.theme', 'vintage'); - $this->conf->write($this->isLoggedIn); - - return true; - } - /** * * `markdown_escape` is a new setting, set to true as default. * diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index 11b6444a..fed175df 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php @@ -469,46 +469,6 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; rmdir('sandbox/'. $theme); } - /** - * Test updateMethodDefaultThemeVintage with the default theme enabled. - */ - public function testSetDefaultThemeToVintage() - { - $sandboxConf = 'sandbox/config'; - copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); - $this->conf = new ConfigManager($sandboxConf); - - $this->conf->set('resource.theme', 'default'); - $updater = new Updater([], [], $this->conf, true); - $this->assertTrue($updater->updateMethodDefaultThemeVintage()); - $this->assertEquals('vintage', $this->conf->get('resource.theme')); - - // reload from file - $this->conf = new ConfigManager($sandboxConf); - $this->assertEquals('vintage', $this->conf->get('resource.theme')); - } - - /** - * Test updateMethodDefaultThemeVintage with custom theme enabled => nothing to do. - */ - public function testSetDefaultThemeNothingToDo() - { - $sandboxConf = 'sandbox/config'; - copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); - $this->conf = new ConfigManager($sandboxConf); - - $theme = 'myawesometheme'; - $this->conf->set('resource.theme', $theme); - $this->conf->write(true); - $updater = new Updater([], [], $this->conf, true); - $this->assertTrue($updater->updateMethodDefaultThemeVintage()); - $this->assertEquals($theme, $this->conf->get('resource.theme')); - - // reload from file - $this->conf = new ConfigManager($sandboxConf); - $this->assertEquals($theme, $this->conf->get('resource.theme')); - } - /** * Test updateMethodEscapeMarkdown with markdown plugin enabled * => setting markdown_escape set to false.