aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/info/InfoTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/controllers/info/InfoTest.php')
-rw-r--r--tests/api/controllers/info/InfoTest.php10
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
2namespace Shaarli\Api\Controllers; 2namespace Shaarli\Api\Controllers;
3 3
4use PHPUnit\Framework\TestCase; 4use malkusch\lock\mutex\NoMutex;
5use Shaarli\Bookmark\BookmarkFileService; 5use Shaarli\Bookmark\BookmarkFileService;
6use Shaarli\Config\ConfigManager; 6use Shaarli\Config\ConfigManager;
7use Shaarli\History; 7use Shaarli\History;
8use Shaarli\TestCase;
8use Slim\Container; 9use Slim\Container;
9use Slim\Http\Environment; 10use Slim\Http\Environment;
10use Slim\Http\Request; 11use 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 }