diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-02-04 11:11:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 11:11:33 +0100 |
commit | 9db1ccdf2ce8381e1f3acb581d3c6a6def095d8c (patch) | |
tree | 97a618b77d327a5f963c91522988e24db5a9e158 /tests/api/controllers/links/DeleteLinkTest.php | |
parent | 8997ae6c8e24286f7d47981eaf905e80d2481c10 (diff) | |
parent | bcba6bd353161fab456b423e93571ab027d5423c (diff) | |
download | Shaarli-master.tar.gz Shaarli-master.tar.zst Shaarli-master.zip |
New plugin hook: ability to add custom filters to Shaarli search engine
Diffstat (limited to 'tests/api/controllers/links/DeleteLinkTest.php')
-rw-r--r-- | tests/api/controllers/links/DeleteLinkTest.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php index 805c9be3..dc2cf917 100644 --- a/tests/api/controllers/links/DeleteLinkTest.php +++ b/tests/api/controllers/links/DeleteLinkTest.php | |||
@@ -7,6 +7,7 @@ use malkusch\lock\mutex\NoMutex; | |||
7 | use Shaarli\Bookmark\BookmarkFileService; | 7 | use Shaarli\Bookmark\BookmarkFileService; |
8 | use Shaarli\Config\ConfigManager; | 8 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\History; | 9 | use Shaarli\History; |
10 | use Shaarli\Plugin\PluginManager; | ||
10 | use Slim\Container; | 11 | use Slim\Container; |
11 | use Slim\Http\Environment; | 12 | use Slim\Http\Environment; |
12 | use Slim\Http\Request; | 13 | use Slim\Http\Request; |
@@ -57,6 +58,9 @@ class DeleteLinkTest extends \Shaarli\TestCase | |||
57 | /** @var NoMutex */ | 58 | /** @var NoMutex */ |
58 | protected $mutex; | 59 | protected $mutex; |
59 | 60 | ||
61 | /** @var PluginManager */ | ||
62 | protected $pluginManager; | ||
63 | |||
60 | /** | 64 | /** |
61 | * Before each test, instantiate a new Api with its config, plugins and bookmarks. | 65 | * Before each test, instantiate a new Api with its config, plugins and bookmarks. |
62 | */ | 66 | */ |
@@ -70,7 +74,14 @@ class DeleteLinkTest extends \Shaarli\TestCase | |||
70 | $refHistory = new \ReferenceHistory(); | 74 | $refHistory = new \ReferenceHistory(); |
71 | $refHistory->write(self::$testHistory); | 75 | $refHistory->write(self::$testHistory); |
72 | $this->history = new History(self::$testHistory); | 76 | $this->history = new History(self::$testHistory); |
73 | $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $this->mutex, true); | 77 | $this->pluginManager = new PluginManager($this->conf); |
78 | $this->bookmarkService = new BookmarkFileService( | ||
79 | $this->conf, | ||
80 | $this->pluginManager, | ||
81 | $this->history, | ||
82 | $this->mutex, | ||
83 | true | ||
84 | ); | ||
74 | 85 | ||
75 | $this->container = new Container(); | 86 | $this->container = new Container(); |
76 | $this->container['conf'] = $this->conf; | 87 | $this->container['conf'] = $this->conf; |
@@ -105,7 +116,13 @@ class DeleteLinkTest extends \Shaarli\TestCase | |||
105 | $this->assertEquals(204, $response->getStatusCode()); | 116 | $this->assertEquals(204, $response->getStatusCode()); |
106 | $this->assertEmpty((string) $response->getBody()); | 117 | $this->assertEmpty((string) $response->getBody()); |
107 | 118 | ||
108 | $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $this->mutex, true); | 119 | $this->bookmarkService = new BookmarkFileService( |
120 | $this->conf, | ||
121 | $this->pluginManager, | ||
122 | $this->history, | ||
123 | $this->mutex, | ||
124 | true | ||
125 | ); | ||
109 | $this->assertFalse($this->bookmarkService->exists($id)); | 126 | $this->assertFalse($this->bookmarkService->exists($id)); |
110 | 127 | ||
111 | $historyEntry = $this->history->getHistory()[0]; | 128 | $historyEntry = $this->history->getHistory()[0]; |