diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-01-17 21:34:12 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-01-18 09:56:32 +0100 |
commit | e26e2060f5470ce8bf4c5973284bae07b8af170a (patch) | |
tree | adf8512f93f5559ba87d0c9931969ae4ebea7133 /tests/api/controllers/tags/GetTagNameTest.php | |
parent | cf92b4dd1521241eefc58eaf6dcd202cd83969d8 (diff) | |
download | Shaarli-e26e2060f5470ce8bf4c5973284bae07b8af170a.tar.gz Shaarli-e26e2060f5470ce8bf4c5973284bae07b8af170a.tar.zst Shaarli-e26e2060f5470ce8bf4c5973284bae07b8af170a.zip |
Add and update unit test for the new system (Bookmark + Service)
See #1307
Diffstat (limited to 'tests/api/controllers/tags/GetTagNameTest.php')
-rw-r--r-- | tests/api/controllers/tags/GetTagNameTest.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php index a2525c17..b9a81f9b 100644 --- a/tests/api/controllers/tags/GetTagNameTest.php +++ b/tests/api/controllers/tags/GetTagNameTest.php | |||
@@ -2,8 +2,10 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Api\Controllers; | 3 | namespace Shaarli\Api\Controllers; |
4 | 4 | ||
5 | use Shaarli\Bookmark\BookmarkFileService; | ||
5 | use Shaarli\Bookmark\LinkDB; | 6 | use Shaarli\Bookmark\LinkDB; |
6 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
8 | use Shaarli\History; | ||
7 | use Slim\Container; | 9 | use Slim\Container; |
8 | use Slim\Http\Environment; | 10 | use Slim\Http\Environment; |
9 | use Slim\Http\Request; | 11 | use Slim\Http\Request; |
@@ -49,17 +51,19 @@ class GetTagNameTest extends \PHPUnit\Framework\TestCase | |||
49 | const NB_FIELDS_TAG = 2; | 51 | const NB_FIELDS_TAG = 2; |
50 | 52 | ||
51 | /** | 53 | /** |
52 | * Before each test, instantiate a new Api with its config, plugins and links. | 54 | * Before each test, instantiate a new Api with its config, plugins and bookmarks. |
53 | */ | 55 | */ |
54 | public function setUp() | 56 | public function setUp() |
55 | { | 57 | { |
56 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 58 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
59 | $this->conf->set('resource.datastore', self::$testDatastore); | ||
57 | $this->refDB = new \ReferenceLinkDB(); | 60 | $this->refDB = new \ReferenceLinkDB(); |
58 | $this->refDB->write(self::$testDatastore); | 61 | $this->refDB->write(self::$testDatastore); |
62 | $history = new History('sandbox/history.php'); | ||
59 | 63 | ||
60 | $this->container = new Container(); | 64 | $this->container = new Container(); |
61 | $this->container['conf'] = $this->conf; | 65 | $this->container['conf'] = $this->conf; |
62 | $this->container['db'] = new LinkDB(self::$testDatastore, true, false); | 66 | $this->container['db'] = new BookmarkFileService($this->conf, $history, true); |
63 | $this->container['history'] = null; | 67 | $this->container['history'] = null; |
64 | 68 | ||
65 | $this->controller = new Tags($this->container); | 69 | $this->controller = new Tags($this->container); |