diff options
Diffstat (limited to 'tests/updater')
-rw-r--r-- | tests/updater/UpdaterTest.php | 19 |
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 @@ | |||
2 | namespace Shaarli\Updater; | 2 | namespace Shaarli\Updater; |
3 | 3 | ||
4 | use Exception; | 4 | use Exception; |
5 | use Shaarli\Bookmark\BookmarkFileService; | ||
6 | use Shaarli\Bookmark\BookmarkServiceInterface; | ||
5 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
8 | use Shaarli\History; | ||
6 | 9 | ||
7 | require_once 'tests/updater/DummyUpdater.php'; | 10 | require_once 'tests/updater/DummyUpdater.php'; |
8 | require_once 'tests/utils/ReferenceLinkDB.php'; | 11 | require_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 | } |