aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/tags/GetTagsTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/controllers/tags/GetTagsTest.php')
-rw-r--r--tests/api/controllers/tags/GetTagsTest.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/api/controllers/tags/GetTagsTest.php b/tests/api/controllers/tags/GetTagsTest.php
index 53a3326d..b565a8c4 100644
--- a/tests/api/controllers/tags/GetTagsTest.php
+++ b/tests/api/controllers/tags/GetTagsTest.php
@@ -1,6 +1,7 @@
1<?php 1<?php
2namespace Shaarli\Api\Controllers; 2namespace Shaarli\Api\Controllers;
3 3
4use malkusch\lock\mutex\NoMutex;
4use Shaarli\Bookmark\BookmarkFileService; 5use Shaarli\Bookmark\BookmarkFileService;
5use Shaarli\Bookmark\LinkDB; 6use Shaarli\Bookmark\LinkDB;
6use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
@@ -17,7 +18,7 @@ use Slim\Http\Response;
17 * 18 *
18 * @package Shaarli\Api\Controllers 19 * @package Shaarli\Api\Controllers
19 */ 20 */
20class GetTagsTest extends \PHPUnit\Framework\TestCase 21class GetTagsTest extends \Shaarli\TestCase
21{ 22{
22 /** 23 /**
23 * @var string datastore to test write operations 24 * @var string datastore to test write operations
@@ -57,15 +58,16 @@ class GetTagsTest extends \PHPUnit\Framework\TestCase
57 /** 58 /**
58 * Before every test, instantiate a new Api with its config, plugins and bookmarks. 59 * Before every test, instantiate a new Api with its config, plugins and bookmarks.
59 */ 60 */
60 public function setUp() 61 protected function setUp(): void
61 { 62 {
63 $mutex = new NoMutex();
62 $this->conf = new ConfigManager('tests/utils/config/configJson'); 64 $this->conf = new ConfigManager('tests/utils/config/configJson');
63 $this->conf->set('resource.datastore', self::$testDatastore); 65 $this->conf->set('resource.datastore', self::$testDatastore);
64 $this->refDB = new \ReferenceLinkDB(); 66 $this->refDB = new \ReferenceLinkDB();
65 $this->refDB->write(self::$testDatastore); 67 $this->refDB->write(self::$testDatastore);
66 $history = new History('sandbox/history.php'); 68 $history = new History('sandbox/history.php');
67 69
68 $this->bookmarkService = new BookmarkFileService($this->conf, $history, true); 70 $this->bookmarkService = new BookmarkFileService($this->conf, $history, $mutex, true);
69 71
70 $this->container = new Container(); 72 $this->container = new Container();
71 $this->container['conf'] = $this->conf; 73 $this->container['conf'] = $this->conf;
@@ -78,7 +80,7 @@ class GetTagsTest extends \PHPUnit\Framework\TestCase
78 /** 80 /**
79 * After every test, remove the test datastore. 81 * After every test, remove the test datastore.
80 */ 82 */
81 public function tearDown() 83 protected function tearDown(): void
82 { 84 {
83 @unlink(self::$testDatastore); 85 @unlink(self::$testDatastore);
84 } 86 }