]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/api/ApiMiddlewareTest.php
Add and update unit test for the new system (Bookmark + Service)
[github/shaarli/Shaarli.git] / tests / api / ApiMiddlewareTest.php
index 23a56b1cee4e78e90aec15941fb4b3927242b32e..df2fb33a7183e306b7bc53344633d93f15003f5b 100644 (file)
@@ -2,7 +2,7 @@
 namespace Shaarli\Api;
 
 use Shaarli\Config\ConfigManager;
-
+use Shaarli\History;
 use Slim\Container;
 use Slim\Http\Environment;
 use Slim\Http\Request;
@@ -18,7 +18,7 @@ use Slim\Http\Response;
  *
  * @package Api
  */
-class ApiMiddlewareTest extends \PHPUnit_Framework_TestCase
+class ApiMiddlewareTest extends \PHPUnit\Framework\TestCase
 {
     /**
      * @var string datastore to test write operations
@@ -41,18 +41,21 @@ 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()
     {
-        $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;
     }
 
     /**