X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FApiBundle%2FController%2FWallabagRestControllerTest.php;h=528366afa08517c6a88d0cde45743286778f0882;hb=28803f106bd091b5a7540a134cba2545d12d25ea;hp=f256a7f9fb37f290c1c0d01478a7bb40aec15cda;hpb=a314b920bf20feedbeee6ce0432be89901091481;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php index f256a7f9..528366af 100644 --- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php @@ -121,6 +121,28 @@ class WallabagRestControllerTest extends WallabagApiTestCase ); } + public function testGetTaggedEntries() + { + $this->client->request('GET', '/api/entries', ['tags' => 'foo,bar']); + + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); + + $content = json_decode($this->client->getResponse()->getContent(), true); + + $this->assertGreaterThanOrEqual(1, count($content)); + $this->assertNotEmpty($content['_embedded']['items']); + $this->assertGreaterThanOrEqual(1, $content['total']); + $this->assertEquals(1, $content['page']); + $this->assertGreaterThanOrEqual(1, $content['pages']); + + $this->assertTrue( + $this->client->getResponse()->headers->contains( + 'Content-Type', + 'application/json' + ) + ); + } + public function testGetDatedEntries() { $this->client->request('GET', '/api/entries', ['since' => 1]);