aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/updater/UpdaterTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-07-06 08:04:35 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit1a8ac737e52cb25a5c346232ee398f5908cee7d7 (patch)
tree31954c4e106b5743e2005d72c2d548a0be8d6dce /tests/updater/UpdaterTest.php
parent6132d64748dfc6806ed25f71d2e078a5ed29d071 (diff)
downloadShaarli-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.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}