diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-11 14:11:06 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-11 14:13:58 +0100 |
commit | 2ea89aba4faa5509ca68c7e9b6b9ab71c1929935 (patch) | |
tree | 6131fcd04c045d6949e97a00ee70ad6505ecb646 /tests/Updater | |
parent | 1739d6b314f410ee79d603f601f2845d55c48b4d (diff) | |
download | Shaarli-2ea89aba4faa5509ca68c7e9b6b9ab71c1929935.tar.gz Shaarli-2ea89aba4faa5509ca68c7e9b6b9ab71c1929935.tar.zst Shaarli-2ea89aba4faa5509ca68c7e9b6b9ab71c1929935.zip |
Fixes #304: use atom feed as default
RSS feed is still available with the setting set to false
Diffstat (limited to 'tests/Updater')
-rw-r--r-- | tests/Updater/UpdaterTest.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index b522d616..11b6444a 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php | |||
@@ -615,4 +615,49 @@ $GLOBALS[\'privateLinkByDefault\'] = true;'; | |||
615 | $this->assertTrue($updater->updateMethodPiwikUrl()); | 615 | $this->assertTrue($updater->updateMethodPiwikUrl()); |
616 | $this->assertEquals($url, $this->conf->get('plugins.PIWIK_URL')); | 616 | $this->assertEquals($url, $this->conf->get('plugins.PIWIK_URL')); |
617 | } | 617 | } |
618 | |||
619 | /** | ||
620 | * Test updateMethodAtomDefault with show_atom set to false | ||
621 | * => update to true. | ||
622 | */ | ||
623 | public function testUpdateMethodAtomDefault() | ||
624 | { | ||
625 | $sandboxConf = 'sandbox/config'; | ||
626 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
627 | $this->conf = new ConfigManager($sandboxConf); | ||
628 | $this->conf->set('feed.show_atom', false); | ||
629 | $updater = new Updater([], [], $this->conf, true); | ||
630 | $this->assertTrue($updater->updateMethodAtomDefault()); | ||
631 | $this->assertTrue($this->conf->get('feed.show_atom')); | ||
632 | // reload from file | ||
633 | $this->conf = new ConfigManager($sandboxConf); | ||
634 | $this->assertTrue($this->conf->get('feed.show_atom')); | ||
635 | } | ||
636 | /** | ||
637 | * Test updateMethodAtomDefault with show_atom not set. | ||
638 | * => nothing to do | ||
639 | */ | ||
640 | public function testUpdateMethodAtomDefaultNoExist() | ||
641 | { | ||
642 | $sandboxConf = 'sandbox/config'; | ||
643 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
644 | $this->conf = new ConfigManager($sandboxConf); | ||
645 | $updater = new Updater([], [], $this->conf, true); | ||
646 | $this->assertTrue($updater->updateMethodAtomDefault()); | ||
647 | $this->assertTrue($this->conf->get('feed.show_atom')); | ||
648 | } | ||
649 | /** | ||
650 | * Test updateMethodAtomDefault with show_atom set to true. | ||
651 | * => nothing to do | ||
652 | */ | ||
653 | public function testUpdateMethodAtomDefaultAlreadyTrue() | ||
654 | { | ||
655 | $sandboxConf = 'sandbox/config'; | ||
656 | copy(self::$configFile . '.json.php', $sandboxConf . '.json.php'); | ||
657 | $this->conf = new ConfigManager($sandboxConf); | ||
658 | $this->conf->set('feed.show_atom', true); | ||
659 | $updater = new Updater([], [], $this->conf, true); | ||
660 | $this->assertTrue($updater->updateMethodAtomDefault()); | ||
661 | $this->assertTrue($this->conf->get('feed.show_atom')); | ||
662 | } | ||
618 | } | 663 | } |