X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FApiBundle%2FController%2FWallabagRestControllerTest.php;fp=tests%2FWallabag%2FApiBundle%2FController%2FWallabagRestControllerTest.php;h=8b49c0ae08dbc9f61e8cf5af35c628cd8e00dfe4;hb=3bd65991adc253715c6b74ab0ee19ff2cf3e6c69;hp=ac4d6cdcfe2b61644667d2a8ce55f1da180cfd5b;hpb=3afc87426dade0eaeccf69d144a119c6f0c4534f;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php index ac4d6cdc..8b49c0ae 100644 --- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php @@ -18,4 +18,21 @@ class WallabagRestControllerTest extends WallabagApiTestCase $this->assertSame($client->getContainer()->getParameter('wallabag_core.version'), $content); } + + public function testGetInfo() + { + // create a new client instead of using $this->client to be sure client isn't authenticated + $client = static::createClient(); + $client->request('GET', '/api/info'); + + $this->assertSame(200, $client->getResponse()->getStatusCode()); + + $content = json_decode($client->getResponse()->getContent(), true); + + $this->assertArrayHasKey('appname', $content); + $this->assertArrayHasKey('version', $content); + $this->assertArrayHasKey('allowed_registration', $content); + + $this->assertSame('wallabag', $content['appname']); + } }