diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-06-25 16:27:38 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-06-29 09:55:57 +0200 |
commit | 28803f106bd091b5a7540a134cba2545d12d25ea (patch) | |
tree | 111ef5e6252e4808f00c21cd8cc7b4813a1a22ff /tests/Wallabag/ApiBundle/Controller | |
parent | a314b920bf20feedbeee6ce0432be89901091481 (diff) | |
download | wallabag-28803f106bd091b5a7540a134cba2545d12d25ea.tar.gz wallabag-28803f106bd091b5a7540a134cba2545d12d25ea.tar.zst wallabag-28803f106bd091b5a7540a134cba2545d12d25ea.zip |
Add filter for tags on API
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
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 | |||
121 | ); | 121 | ); |
122 | } | 122 | } |
123 | 123 | ||
124 | public function testGetTaggedEntries() | ||
125 | { | ||
126 | $this->client->request('GET', '/api/entries', ['tags' => 'foo,bar']); | ||
127 | |||
128 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | ||
129 | |||
130 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
131 | |||
132 | $this->assertGreaterThanOrEqual(1, count($content)); | ||
133 | $this->assertNotEmpty($content['_embedded']['items']); | ||
134 | $this->assertGreaterThanOrEqual(1, $content['total']); | ||
135 | $this->assertEquals(1, $content['page']); | ||
136 | $this->assertGreaterThanOrEqual(1, $content['pages']); | ||
137 | |||
138 | $this->assertTrue( | ||
139 | $this->client->getResponse()->headers->contains( | ||
140 | 'Content-Type', | ||
141 | 'application/json' | ||
142 | ) | ||
143 | ); | ||
144 | } | ||
145 | |||
124 | public function testGetDatedEntries() | 146 | public function testGetDatedEntries() |
125 | { | 147 | { |
126 | $this->client->request('GET', '/api/entries', ['since' => 1]); | 148 | $this->client->request('GET', '/api/entries', ['since' => 1]); |