X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Finfo%2FInfoTest.php;h=1598e1e8ac8e8edec612eb79cbe969ed22f1676f;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=f7e63bfaf2623e498ce0f9605c76aad7e517975b;hpb=9cc6ea6560660f6616dcd28d71d19625cf372a71;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php index f7e63bfa..1598e1e8 100644 --- a/tests/api/controllers/info/InfoTest.php +++ b/tests/api/controllers/info/InfoTest.php @@ -1,8 +1,10 @@ conf = new ConfigManager('tests/utils/config/configJson.json.php'); + $this->conf = new ConfigManager('tests/utils/config/configJson'); + $this->conf->set('resource.datastore', self::$testDatastore); $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['db'] = new \LinkDB(self::$testDatastore, true, false); + $this->container['db'] = new BookmarkFileService($this->conf, $history, true); $this->container['history'] = null; $this->controller = new Info($this->container); @@ -62,7 +67,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 +90,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');