diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-05-10 18:25:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 18:25:56 +0200 |
commit | 61c15aa5554431893ea5ebe800a9a625dca5aff9 (patch) | |
tree | cd7885a3f05d79f7d3e096d5d44b3e00bc538542 | |
parent | 3aa7aa0ef0c1351815a827777e752615f5781545 (diff) | |
parent | 845810a8d3c2ad5836f12516a6f38e7720bb0f4d (diff) | |
download | Shaarli-61c15aa5554431893ea5ebe800a9a625dca5aff9.tar.gz Shaarli-61c15aa5554431893ea5ebe800a9a625dca5aff9.tar.zst Shaarli-61c15aa5554431893ea5ebe800a9a625dca5aff9.zip |
Merge pull request #868 from ArthurHoaro/theme/default-as-default
Use the new 'default' theme... as default
-rw-r--r-- | application/Updater.php | 15 | ||||
-rw-r--r-- | tests/Updater/UpdaterTest.php | 40 |
2 files changed, 0 insertions, 55 deletions
diff --git a/application/Updater.php b/application/Updater.php index 03d93a6f..40a15906 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -329,21 +329,6 @@ class Updater | |||
329 | } | 329 | } |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * While the new default theme is in an unstable state | ||
333 | * continue to use the vintage theme | ||
334 | */ | ||
335 | public function updateMethodDefaultThemeVintage() | ||
336 | { | ||
337 | if ($this->conf->get('resource.theme') !== 'default') { | ||
338 | return true; | ||
339 | } | ||
340 | $this->conf->set('resource.theme', 'vintage'); | ||
341 | $this->conf->write($this->isLoggedIn); | ||
342 | |||
343 | return true; | ||
344 | } | ||
345 | |||
346 | /** | ||
347 | * * `markdown_escape` is a new setting, set to true as default. | 332 | * * `markdown_escape` is a new setting, set to true as default. |
348 | * | 333 | * |
349 | * If the markdown plugin was already enabled, escaping is disabled to avoid | 334 | * If the markdown plugin was already enabled, escaping is disabled to avoid |
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 | |||
@@ -470,46 +470,6 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; | |||
470 | } | 470 | } |
471 | 471 | ||
472 | /** | 472 | /** |
473 | * Test updateMethodDefaultThemeVintage with the default theme enabled. | ||
474 | */ | ||
475 | public function testSetDefaultThemeToVintage() | ||
476 | { | ||
477 | $sandboxConf = 'sandbox/config'; | ||
478 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
479 | $this->conf = new ConfigManager($sandboxConf); | ||
480 | |||
481 | $this->conf->set('resource.theme', 'default'); | ||
482 | $updater = new Updater([], [], $this->conf, true); | ||
483 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
484 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
485 | |||
486 | // reload from file | ||
487 | $this->conf = new ConfigManager($sandboxConf); | ||
488 | $this->assertEquals('vintage', $this->conf->get('resource.theme')); | ||
489 | } | ||
490 | |||
491 | /** | ||
492 | * Test updateMethodDefaultThemeVintage with custom theme enabled => nothing to do. | ||
493 | */ | ||
494 | public function testSetDefaultThemeNothingToDo() | ||
495 | { | ||
496 | $sandboxConf = 'sandbox/config'; | ||
497 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
498 | $this->conf = new ConfigManager($sandboxConf); | ||
499 | |||
500 | $theme = 'myawesometheme'; | ||
501 | $this->conf->set('resource.theme', $theme); | ||
502 | $this->conf->write(true); | ||
503 | $updater = new Updater([], [], $this->conf, true); | ||
504 | $this->assertTrue($updater->updateMethodDefaultThemeVintage()); | ||
505 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
506 | |||
507 | // reload from file | ||
508 | $this->conf = new ConfigManager($sandboxConf); | ||
509 | $this->assertEquals($theme, $this->conf->get('resource.theme')); | ||
510 | } | ||
511 | |||
512 | /** | ||
513 | * Test updateMethodEscapeMarkdown with markdown plugin enabled | 473 | * Test updateMethodEscapeMarkdown with markdown plugin enabled |
514 | * => setting markdown_escape set to false. | 474 | * => setting markdown_escape set to false. |
515 | */ | 475 | */ |