]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/api/ApiMiddlewareTest.php
Merge pull request #1569 from ArthurHoaro/fix/bad-encoding
[github/shaarli/Shaarli.git] / tests / api / ApiMiddlewareTest.php
index 0b9b03f28ec7c0d824e23484395d60dd867f06a4..b157e4a77ae5202b3a9e06be2cb7cd7a17904506 100644 (file)
@@ -2,6 +2,7 @@
 namespace Shaarli\Api;
 
 use Shaarli\Config\ConfigManager;
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -40,24 +41,27 @@ class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase
     protected $container;
 
     /**
-     * Before every test, instantiate a new Api with its config, plugins and links.
+     * Before every test, instantiate a new Api with its config, plugins and bookmarks.
      */
-    public function setUp()
+    protected function setUp(): void
     {
-        $this->conf = new ConfigManager('tests/utils/config/configJson.json.php');
+        $this->conf = new ConfigManager('tests/utils/config/configJson');
         $this->conf->set('api.secret', 'NapoleonWasALizard');
 
         $this->refDB = new \ReferenceLinkDB();
         $this->refDB->write(self::$testDatastore);
 
+        $history = new History('sandbox/history.php');
+
         $this->container = new Container();
         $this->container['conf'] = $this->conf;
+        $this->container['history'] = $history;
     }
 
     /**
      * After every test, remove the test datastore.
      */
-    public function tearDown()
+    protected function tearDown(): void
     {
         @unlink(self::$testDatastore);
     }