diff options
Diffstat (limited to 'tests/api/controllers/tags/DeleteTagTest.php')
-rw-r--r-- | tests/api/controllers/tags/DeleteTagTest.php | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index 37f07229..c0f8a6a9 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php | |||
@@ -8,6 +8,7 @@ use Shaarli\Bookmark\BookmarkFileService; | |||
8 | use Shaarli\Bookmark\LinkDB; | 8 | use Shaarli\Bookmark\LinkDB; |
9 | use Shaarli\Config\ConfigManager; | 9 | use Shaarli\Config\ConfigManager; |
10 | use Shaarli\History; | 10 | use Shaarli\History; |
11 | use Shaarli\Plugin\PluginManager; | ||
11 | use Slim\Container; | 12 | use Slim\Container; |
12 | use Slim\Http\Environment; | 13 | use Slim\Http\Environment; |
13 | use Slim\Http\Request; | 14 | use Slim\Http\Request; |
@@ -55,6 +56,9 @@ class DeleteTagTest extends \Shaarli\TestCase | |||
55 | */ | 56 | */ |
56 | protected $controller; | 57 | protected $controller; |
57 | 58 | ||
59 | /** @var PluginManager */ | ||
60 | protected $pluginManager; | ||
61 | |||
58 | /** @var NoMutex */ | 62 | /** @var NoMutex */ |
59 | protected $mutex; | 63 | protected $mutex; |
60 | 64 | ||
@@ -71,7 +75,14 @@ class DeleteTagTest extends \Shaarli\TestCase | |||
71 | $refHistory = new \ReferenceHistory(); | 75 | $refHistory = new \ReferenceHistory(); |
72 | $refHistory->write(self::$testHistory); | 76 | $refHistory->write(self::$testHistory); |
73 | $this->history = new History(self::$testHistory); | 77 | $this->history = new History(self::$testHistory); |
74 | $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $this->mutex, true); | 78 | $this->pluginManager = new PluginManager($this->conf); |
79 | $this->bookmarkService = new BookmarkFileService( | ||
80 | $this->conf, | ||
81 | $this->pluginManager, | ||
82 | $this->history, | ||
83 | $this->mutex, | ||
84 | true | ||
85 | ); | ||
75 | 86 | ||
76 | $this->container = new Container(); | 87 | $this->container = new Container(); |
77 | $this->container['conf'] = $this->conf; | 88 | $this->container['conf'] = $this->conf; |
@@ -107,7 +118,13 @@ class DeleteTagTest extends \Shaarli\TestCase | |||
107 | $this->assertEquals(204, $response->getStatusCode()); | 118 | $this->assertEquals(204, $response->getStatusCode()); |
108 | $this->assertEmpty((string) $response->getBody()); | 119 | $this->assertEmpty((string) $response->getBody()); |
109 | 120 | ||
110 | $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $this->mutex, true); | 121 | $this->bookmarkService = new BookmarkFileService( |
122 | $this->conf, | ||
123 | $this->pluginManager, | ||
124 | $this->history, | ||
125 | $this->mutex, | ||
126 | true | ||
127 | ); | ||
111 | $tags = $this->bookmarkService->bookmarksCountPerTag(); | 128 | $tags = $this->bookmarkService->bookmarksCountPerTag(); |
112 | $this->assertFalse(isset($tags[$tagName])); | 129 | $this->assertFalse(isset($tags[$tagName])); |
113 | 130 | ||
@@ -141,7 +158,13 @@ class DeleteTagTest extends \Shaarli\TestCase | |||
141 | $this->assertEquals(204, $response->getStatusCode()); | 158 | $this->assertEquals(204, $response->getStatusCode()); |
142 | $this->assertEmpty((string) $response->getBody()); | 159 | $this->assertEmpty((string) $response->getBody()); |
143 | 160 | ||
144 | $this->bookmarkService = new BookmarkFileService($this->conf, $this->history, $this->mutex, true); | 161 | $this->bookmarkService = new BookmarkFileService( |
162 | $this->conf, | ||
163 | $this->pluginManager, | ||
164 | $this->history, | ||
165 | $this->mutex, | ||
166 | true | ||
167 | ); | ||
145 | $tags = $this->bookmarkService->bookmarksCountPerTag(); | 168 | $tags = $this->bookmarkService->bookmarksCountPerTag(); |
146 | $this->assertFalse(isset($tags[$tagName])); | 169 | $this->assertFalse(isset($tags[$tagName])); |
147 | $this->assertTrue($tags[strtolower($tagName)] > 0); | 170 | $this->assertTrue($tags[strtolower($tagName)] > 0); |