diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-06 08:04:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | 1a8ac737e52cb25a5c346232ee398f5908cee7d7 (patch) | |
tree | 31954c4e106b5743e2005d72c2d548a0be8d6dce /tests/updater/UpdaterTest.php | |
parent | 6132d64748dfc6806ed25f71d2e078a5ed29d071 (diff) | |
download | Shaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.tar.gz Shaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.tar.zst Shaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.zip |
Process main page (linklist) through Slim controller
Including a bunch of improvements on the container,
and helper used across new controllers.
Diffstat (limited to 'tests/updater/UpdaterTest.php')
-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 | } |