diff options
Diffstat (limited to 'tests/api/controllers/info/InfoTest.php')
-rw-r--r-- | tests/api/controllers/info/InfoTest.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index b5c938e1..10b29ab2 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php | |||
@@ -1,10 +1,11 @@ | |||
1 | <?php | 1 | <?php |
2 | namespace Shaarli\Api\Controllers; | 2 | namespace Shaarli\Api\Controllers; |
3 | 3 | ||
4 | use PHPUnit\Framework\TestCase; | 4 | use malkusch\lock\mutex\NoMutex; |
5 | use Shaarli\Bookmark\BookmarkFileService; | 5 | use Shaarli\Bookmark\BookmarkFileService; |
6 | use Shaarli\Config\ConfigManager; | 6 | use Shaarli\Config\ConfigManager; |
7 | use Shaarli\History; | 7 | use Shaarli\History; |
8 | use Shaarli\TestCase; | ||
8 | use Slim\Container; | 9 | use Slim\Container; |
9 | use Slim\Http\Environment; | 10 | use Slim\Http\Environment; |
10 | use Slim\Http\Request; | 11 | use Slim\Http\Request; |
@@ -47,8 +48,9 @@ class InfoTest extends TestCase | |||
47 | /** | 48 | /** |
48 | * Before every test, instantiate a new Api with its config, plugins and bookmarks. | 49 | * Before every test, instantiate a new Api with its config, plugins and bookmarks. |
49 | */ | 50 | */ |
50 | public function setUp() | 51 | protected function setUp(): void |
51 | { | 52 | { |
53 | $mutex = new NoMutex(); | ||
52 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 54 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
53 | $this->conf->set('resource.datastore', self::$testDatastore); | 55 | $this->conf->set('resource.datastore', self::$testDatastore); |
54 | $this->refDB = new \ReferenceLinkDB(); | 56 | $this->refDB = new \ReferenceLinkDB(); |
@@ -58,7 +60,7 @@ class InfoTest extends TestCase | |||
58 | 60 | ||
59 | $this->container = new Container(); | 61 | $this->container = new Container(); |
60 | $this->container['conf'] = $this->conf; | 62 | $this->container['conf'] = $this->conf; |
61 | $this->container['db'] = new BookmarkFileService($this->conf, $history, true); | 63 | $this->container['db'] = new BookmarkFileService($this->conf, $history, $mutex, true); |
62 | $this->container['history'] = null; | 64 | $this->container['history'] = null; |
63 | 65 | ||
64 | $this->controller = new Info($this->container); | 66 | $this->controller = new Info($this->container); |
@@ -67,7 +69,7 @@ class InfoTest extends TestCase | |||
67 | /** | 69 | /** |
68 | * After every test, remove the test datastore. | 70 | * After every test, remove the test datastore. |
69 | */ | 71 | */ |
70 | public function tearDown() | 72 | protected function tearDown(): void |
71 | { | 73 | { |
72 | @unlink(self::$testDatastore); | 74 | @unlink(self::$testDatastore); |
73 | } | 75 | } |