aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/updater
diff options
context:
space:
mode:
Diffstat (limited to 'tests/updater')
-rw-r--r--tests/updater/UpdaterTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php
index c689982b..afc35aec 100644
--- a/tests/updater/UpdaterTest.php
+++ b/tests/updater/UpdaterTest.php
@@ -2,7 +2,10 @@
2namespace Shaarli\Updater; 2namespace Shaarli\Updater;
3 3
4use Exception; 4use Exception;
5use Shaarli\Bookmark\BookmarkFileService;
6use Shaarli\Bookmark\BookmarkServiceInterface;
5use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
8use Shaarli\History;
6 9
7require_once 'tests/updater/DummyUpdater.php'; 10require_once 'tests/updater/DummyUpdater.php';
8require_once 'tests/utils/ReferenceLinkDB.php'; 11require_once 'tests/utils/ReferenceLinkDB.php';
@@ -29,6 +32,12 @@ class UpdaterTest extends \PHPUnit\Framework\TestCase
29 */ 32 */
30 protected $conf; 33 protected $conf;
31 34
35 /** @var BookmarkServiceInterface */
36 protected $bookmarkService;
37
38 /** @var Updater */
39 protected $updater;
40
32 /** 41 /**
33 * Executed before each test. 42 * Executed before each test.
34 */ 43 */
@@ -36,6 +45,8 @@ class UpdaterTest extends \PHPUnit\Framework\TestCase
36 { 45 {
37 copy('tests/utils/config/configJson.json.php', self::$configFile .'.json.php'); 46 copy('tests/utils/config/configJson.json.php', self::$configFile .'.json.php');
38 $this->conf = new ConfigManager(self::$configFile); 47 $this->conf = new ConfigManager(self::$configFile);
48 $this->bookmarkService = new BookmarkFileService($this->conf, $this->createMock(History::class), true);
49 $this->updater = new Updater([], $this->bookmarkService, $this->conf, true);
39 } 50 }
40 51
41 /** 52 /**
@@ -167,4 +178,12 @@ class UpdaterTest extends \PHPUnit\Framework\TestCase
167 $updater = new DummyUpdater($updates, array(), $this->conf, true); 178 $updater = new DummyUpdater($updates, array(), $this->conf, true);
168 $updater->update(); 179 $updater->update();
169 } 180 }
181
182 public function testUpdateMethodRelativeHomeLinkRename(): void
183 {
184 $this->conf->set('general.header_link', '?');
185 $this->updater->updateMethodRelativeHomeLink();
186
187 static::assertSame();
188 }
170} 189}