aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/updater
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-02-09 13:52:12 +0100
committerArthurHoaro <arthur@hoa.ro>2019-02-09 13:55:11 +0100
commit520d29578c57e476ece3bdd20c286d196b7b61b4 (patch)
tree6f221285ec8e30d6ddfb32e996949738ebaa410a /tests/updater
parent905f8675a728841b03b300d2c7dc909a1c4f7f03 (diff)
downloadShaarli-520d29578c57e476ece3bdd20c286d196b7b61b4.tar.gz
Shaarli-520d29578c57e476ece3bdd20c286d196b7b61b4.tar.zst
Shaarli-520d29578c57e476ece3bdd20c286d196b7b61b4.zip
Remove the redirector setting
Fixes #1239
Diffstat (limited to 'tests/updater')
-rw-r--r--tests/updater/UpdaterTest.php19
1 files changed, 15 insertions, 4 deletions
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;';
287 $this->conf = new ConfigManager($sandbox); 287 $this->conf = new ConfigManager($sandbox);
288 $title = '<script>alert("title");</script>'; 288 $title = '<script>alert("title");</script>';
289 $headerLink = '<script>alert("header_link");</script>'; 289 $headerLink = '<script>alert("header_link");</script>';
290 $redirectorUrl = '<script>alert("redirector");</script>';
291 $this->conf->set('general.title', $title); 290 $this->conf->set('general.title', $title);
292 $this->conf->set('general.header_link', $headerLink); 291 $this->conf->set('general.header_link', $headerLink);
293 $this->conf->set('redirector.url', $redirectorUrl);
294 $updater = new Updater(array(), array(), $this->conf, true); 292 $updater = new Updater(array(), array(), $this->conf, true);
295 $done = $updater->updateMethodEscapeUnescapedConfig(); 293 $done = $updater->updateMethodEscapeUnescapedConfig();
296 $this->assertTrue($done); 294 $this->assertTrue($done);
297 $this->conf->reload(); 295 $this->conf->reload();
298 $this->assertEquals(escape($title), $this->conf->get('general.title')); 296 $this->assertEquals(escape($title), $this->conf->get('general.title'));
299 $this->assertEquals(escape($headerLink), $this->conf->get('general.header_link')); 297 $this->assertEquals(escape($headerLink), $this->conf->get('general.header_link'));
300 $this->assertEquals(escape($redirectorUrl), $this->conf->get('redirector.url'));
301 unlink($sandbox . '.json.php'); 298 unlink($sandbox . '.json.php');
302 } 299 }
303 300
@@ -707,7 +704,6 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
707 } 704 }
708 705
709 /** 706 /**
710<<<<<<< HEAD
711 * Test updateMethodWebThumbnailer with thumbnails enabled. 707 * Test updateMethodWebThumbnailer with thumbnails enabled.
712 */ 708 */
713 public function testUpdateMethodWebThumbnailerEnabled() 709 public function testUpdateMethodWebThumbnailerEnabled()
@@ -812,4 +808,19 @@ $GLOBALS[\'privateLinkByDefault\'] = true;';
812 $linkDB = new LinkDB(self::$testDatastore, true, false); 808 $linkDB = new LinkDB(self::$testDatastore, true, false);
813 $this->assertTrue($linkDB[1]['sticky']); 809 $this->assertTrue($linkDB[1]['sticky']);
814 } 810 }
811
812 /**
813 * Test updateMethodRemoveRedirector().
814 */
815 public function testUpdateRemoveRedirector()
816 {
817 $sandboxConf = 'sandbox/config';
818 copy(self::$configFile . '.json.php', $sandboxConf . '.json.php');
819 $this->conf = new ConfigManager($sandboxConf);
820 $updater = new Updater([], null, $this->conf, true);
821 $this->assertTrue($updater->updateMethodRemoveRedirector());
822 $this->assertFalse($this->conf->exists('redirector'));
823 $this->conf = new ConfigManager($sandboxConf);
824 $this->assertFalse($this->conf->exists('redirector'));
825 }
815} 826}