X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fupdater%2FUpdaterTest.php;h=93bc86c1b72a1ae5457fbd89847bbcf2f4730803;hb=520d29578c57e476ece3bdd20c286d196b7b61b4;hp=d7df59637395ddf9a7d4760eecefa5db4a32a97e;hpb=905f8675a728841b03b300d2c7dc909a1c4f7f03;p=github%2Fshaarli%2FShaarli.git
diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php
index d7df5963..93bc86c1 100644
--- a/tests/updater/UpdaterTest.php
+++ b/tests/updater/UpdaterTest.php
@@ -287,17 +287,14 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
$this->conf = new ConfigManager($sandbox);
$title = '';
$headerLink = '';
- $redirectorUrl = '';
$this->conf->set('general.title', $title);
$this->conf->set('general.header_link', $headerLink);
- $this->conf->set('redirector.url', $redirectorUrl);
$updater = new Updater(array(), array(), $this->conf, true);
$done = $updater->updateMethodEscapeUnescapedConfig();
$this->assertTrue($done);
$this->conf->reload();
$this->assertEquals(escape($title), $this->conf->get('general.title'));
$this->assertEquals(escape($headerLink), $this->conf->get('general.header_link'));
- $this->assertEquals(escape($redirectorUrl), $this->conf->get('redirector.url'));
unlink($sandbox . '.json.php');
}
@@ -707,7 +704,6 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
}
/**
-<<<<<<< HEAD
* Test updateMethodWebThumbnailer with thumbnails enabled.
*/
public function testUpdateMethodWebThumbnailerEnabled()
@@ -812,4 +808,19 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
$linkDB = new LinkDB(self::$testDatastore, true, false);
$this->assertTrue($linkDB[1]['sticky']);
}
+
+ /**
+ * Test updateMethodRemoveRedirector().
+ */
+ public function testUpdateRemoveRedirector()
+ {
+ $sandboxConf = 'sandbox/config';
+ copy(self::$configFile . '.json.php', $sandboxConf . '.json.php');
+ $this->conf = new ConfigManager($sandboxConf);
+ $updater = new Updater([], null, $this->conf, true);
+ $this->assertTrue($updater->updateMethodRemoveRedirector());
+ $this->assertFalse($this->conf->exists('redirector'));
+ $this->conf = new ConfigManager($sandboxConf);
+ $this->assertFalse($this->conf->exists('redirector'));
+ }
}