Fixes #304: use atom feed as default
RSS feed is still available with the setting set to false
This commit is contained in:
parent
1739d6b314
commit
2ea89aba4f
5 changed files with 66 additions and 4 deletions
tests/Updater
|
@ -615,4 +615,49 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
|
|||
$this->assertTrue($updater->updateMethodPiwikUrl());
|
||||
$this->assertEquals($url, $this->conf->get('plugins.PIWIK_URL'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test updateMethodAtomDefault with show_atom set to false
|
||||
* => update to true.
|
||||
*/
|
||||
public function testUpdateMethodAtomDefault()
|
||||
{
|
||||
$sandboxConf = 'sandbox/config';
|
||||
copy(self::$configFile . '.json.php', $sandboxConf . '.json.php');
|
||||
$this->conf = new ConfigManager($sandboxConf);
|
||||
$this->conf->set('feed.show_atom', false);
|
||||
$updater = new Updater([], [], $this->conf, true);
|
||||
$this->assertTrue($updater->updateMethodAtomDefault());
|
||||
$this->assertTrue($this->conf->get('feed.show_atom'));
|
||||
// reload from file
|
||||
$this->conf = new ConfigManager($sandboxConf);
|
||||
$this->assertTrue($this->conf->get('feed.show_atom'));
|
||||
}
|
||||
/**
|
||||
* Test updateMethodAtomDefault with show_atom not set.
|
||||
* => nothing to do
|
||||
*/
|
||||
public function testUpdateMethodAtomDefaultNoExist()
|
||||
{
|
||||
$sandboxConf = 'sandbox/config';
|
||||
copy(self::$configFile . '.json.php', $sandboxConf . '.json.php');
|
||||
$this->conf = new ConfigManager($sandboxConf);
|
||||
$updater = new Updater([], [], $this->conf, true);
|
||||
$this->assertTrue($updater->updateMethodAtomDefault());
|
||||
$this->assertTrue($this->conf->get('feed.show_atom'));
|
||||
}
|
||||
/**
|
||||
* Test updateMethodAtomDefault with show_atom set to true.
|
||||
* => nothing to do
|
||||
*/
|
||||
public function testUpdateMethodAtomDefaultAlreadyTrue()
|
||||
{
|
||||
$sandboxConf = 'sandbox/config';
|
||||
copy(self::$configFile . '.json.php', $sandboxConf . '.json.php');
|
||||
$this->conf = new ConfigManager($sandboxConf);
|
||||
$this->conf->set('feed.show_atom', true);
|
||||
$updater = new Updater([], [], $this->conf, true);
|
||||
$this->assertTrue($updater->updateMethodAtomDefault());
|
||||
$this->assertTrue($this->conf->get('feed.show_atom'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue