aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-03-21 20:10:49 +0100
committerGitHub <noreply@github.com>2017-03-21 20:10:49 +0100
commitc4c655d9bfe68a914898d76bb9c479eea1b04f72 (patch)
treef3c681508a588d516e50b33581b6e4b6e90f7326 /tests
parent4bad4bde5a2b8dcbb00e95662e30b4694fe97266 (diff)
parent2ea89aba4faa5509ca68c7e9b6b9ab71c1929935 (diff)
downloadShaarli-c4c655d9bfe68a914898d76bb9c479eea1b04f72.tar.gz
Shaarli-c4c655d9bfe68a914898d76bb9c479eea1b04f72.tar.zst
Shaarli-c4c655d9bfe68a914898d76bb9c479eea1b04f72.zip
Merge pull request #804 from ArthurHoaro/feature/atom-default
Fixes #304: use atom feed as default
Diffstat (limited to 'tests')
-rw-r--r--tests/Updater/UpdaterTest.php45
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}