X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2FInfoTest.php;h=f7e63bfaf2623e498ce0f9605c76aad7e517975b;hb=4294bc7b98c8f45ceaac867cad3d5d35ee9eb096;hp=2916eed8cbfdf286687aaa92c3c2283de1f45843;hpb=18e6796726d73d7dc90ecdd16c181493941f5487;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/InfoTest.php b/tests/api/controllers/InfoTest.php index 2916eed8..f7e63bfa 100644 --- a/tests/api/controllers/InfoTest.php +++ b/tests/api/controllers/InfoTest.php @@ -1,7 +1,8 @@ conf = new \ConfigManager('tests/utils/config/configJson.json.php'); + $this->conf = new ConfigManager('tests/utils/config/configJson.json.php'); $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); $this->container = new Container(); $this->container['conf'] = $this->conf; $this->container['db'] = new \LinkDB(self::$testDatastore, true, false); + $this->container['history'] = null; $this->controller = new Info($this->container); } @@ -79,12 +81,12 @@ class InfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals(200, $response->getStatusCode()); $data = json_decode((string) $response->getBody(), true); - $this->assertEquals(8, $data['global_counter']); + $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']); $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(\ConfigManager::$DEFAULT_PLUGINS, $data['settings']['enabled_plugins']); + $this->assertEquals(ConfigManager::$DEFAULT_PLUGINS, $data['settings']['enabled_plugins']); $this->assertEquals(false, $data['settings']['default_private_links']); $title = 'My links'; @@ -102,7 +104,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals(200, $response->getStatusCode()); $data = json_decode((string) $response->getBody(), true); - $this->assertEquals(8, $data['global_counter']); + $this->assertEquals(\ReferenceLinkDB::$NB_LINKS_TOTAL, $data['global_counter']); $this->assertEquals(2, $data['private_counter']); $this->assertEquals($title, $data['settings']['title']); $this->assertEquals($headerLink, $data['settings']['header_link']);