diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-11-12 13:02:36 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-11-12 13:02:36 +0100 |
commit | 1409f1c89a7ca01456ae2dcd6357d296e2b99f5a (patch) | |
tree | ffa30a9358e82d27be75d8fc5e57f3c8820dc6d3 /tests/api/controllers/links/GetLinksTest.php | |
parent | 054e03f37fa29da8066f1a637919f13c7e7dc5d2 (diff) | |
parent | a6935feb22df8d9634189ee87d257da9f03eedbd (diff) | |
download | Shaarli-1409f1c89a7ca01456ae2dcd6357d296e2b99f5a.tar.gz Shaarli-1409f1c89a7ca01456ae2dcd6357d296e2b99f5a.tar.zst Shaarli-1409f1c89a7ca01456ae2dcd6357d296e2b99f5a.zip |
Diffstat (limited to 'tests/api/controllers/links/GetLinksTest.php')
-rw-r--r-- | tests/api/controllers/links/GetLinksTest.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/api/controllers/links/GetLinksTest.php b/tests/api/controllers/links/GetLinksTest.php index ca1bfc63..b1c46ee2 100644 --- a/tests/api/controllers/links/GetLinksTest.php +++ b/tests/api/controllers/links/GetLinksTest.php | |||
@@ -1,6 +1,7 @@ | |||
1 | <?php | 1 | <?php |
2 | namespace Shaarli\Api\Controllers; | 2 | namespace Shaarli\Api\Controllers; |
3 | 3 | ||
4 | use malkusch\lock\mutex\NoMutex; | ||
4 | use Shaarli\Bookmark\Bookmark; | 5 | use Shaarli\Bookmark\Bookmark; |
5 | use Shaarli\Bookmark\BookmarkFileService; | 6 | use Shaarli\Bookmark\BookmarkFileService; |
6 | use Shaarli\Bookmark\LinkDB; | 7 | use Shaarli\Bookmark\LinkDB; |
@@ -57,6 +58,7 @@ class GetLinksTest extends \Shaarli\TestCase | |||
57 | */ | 58 | */ |
58 | protected function setUp(): void | 59 | protected function setUp(): void |
59 | { | 60 | { |
61 | $mutex = new NoMutex(); | ||
60 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 62 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
61 | $this->conf->set('resource.datastore', self::$testDatastore); | 63 | $this->conf->set('resource.datastore', self::$testDatastore); |
62 | $this->refDB = new \ReferenceLinkDB(); | 64 | $this->refDB = new \ReferenceLinkDB(); |
@@ -65,7 +67,7 @@ class GetLinksTest extends \Shaarli\TestCase | |||
65 | 67 | ||
66 | $this->container = new Container(); | 68 | $this->container = new Container(); |
67 | $this->container['conf'] = $this->conf; | 69 | $this->container['conf'] = $this->conf; |
68 | $this->container['db'] = new BookmarkFileService($this->conf, $history, true); | 70 | $this->container['db'] = new BookmarkFileService($this->conf, $history, $mutex, true); |
69 | $this->container['history'] = null; | 71 | $this->container['history'] = null; |
70 | 72 | ||
71 | $this->controller = new Links($this->container); | 73 | $this->controller = new Links($this->container); |
@@ -396,7 +398,7 @@ class GetLinksTest extends \Shaarli\TestCase | |||
396 | $response = $this->controller->getLinks($request, new Response()); | 398 | $response = $this->controller->getLinks($request, new Response()); |
397 | $this->assertEquals(200, $response->getStatusCode()); | 399 | $this->assertEquals(200, $response->getStatusCode()); |
398 | $data = json_decode((string) $response->getBody(), true); | 400 | $data = json_decode((string) $response->getBody(), true); |
399 | $this->assertEquals(4, count($data)); | 401 | $this->assertEquals(5, count($data)); |
400 | $this->assertEquals(6, $data[0]['id']); | 402 | $this->assertEquals(6, $data[0]['id']); |
401 | 403 | ||
402 | // wildcard: placeholder at the middle | 404 | // wildcard: placeholder at the middle |