X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Finfo%2FInfoTest.php;h=2428ca4307f2640765d4ab2493bf80e0382139d0;hb=bcba6bd353161fab456b423e93571ab027d5423c;hp=44a9382e847381196d52e5c28393ba056760907e;hpb=f24896b237e40718fb6eaa2869592eb0855a47fd;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index 44a9382e..2428ca43 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php @@ -1,8 +1,12 @@ conf = new ConfigManager('tests/utils/config/configJson.json.php'); + $mutex = new NoMutex(); + $this->conf = new ConfigManager('tests/utils/config/configJson'); + $this->conf->set('resource.datastore', self::$testDatastore); $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); + $this->pluginManager = new PluginManager($this->conf); + $history = new History('sandbox/history.php'); $this->container = new Container(); $this->container['conf'] = $this->conf; - $this->container['db'] = new \Shaarli\Bookmark\LinkDB(self::$testDatastore, true, false); + $this->container['db'] = new BookmarkFileService( + $this->conf, + $this->pluginManager, + $history, + $mutex, + true + ); $this->container['history'] = null; $this->controller = new Info($this->container); @@ -62,7 +76,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase /** * After every test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); } @@ -85,11 +99,11 @@ class InfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals(2, $data['private_counter']); $this->assertEquals('Shaarli', $data['settings']['title']); $this->assertEquals('?', $data['settings']['header_link']); - $this->assertEquals('UTC', $data['settings']['timezone']); + $this->assertEquals('Europe/Paris', $data['settings']['timezone']); $this->assertEquals(ConfigManager::$DEFAULT_PLUGINS, $data['settings']['enabled_plugins']); - $this->assertEquals(false, $data['settings']['default_private_links']); + $this->assertEquals(true, $data['settings']['default_private_links']); - $title = 'My links'; + $title = 'My bookmarks'; $headerLink = 'http://shaarli.tld'; $timezone = 'Europe/Paris'; $enabledPlugins = array('foo', 'bar');