X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2FApiMiddlewareTest.php;h=b157e4a77ae5202b3a9e06be2cb7cd7a17904506;hb=c3fca560b624588d37508142ab73573caf467573;hp=23a56b1cee4e78e90aec15941fb4b3927242b32e;hpb=3c66e56435359dc678048193e8ee239d06f79b64;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/ApiMiddlewareTest.php b/tests/api/ApiMiddlewareTest.php index 23a56b1c..b157e4a7 100644 --- a/tests/api/ApiMiddlewareTest.php +++ b/tests/api/ApiMiddlewareTest.php @@ -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,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); }