diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-05-09 09:12:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 09:12:15 +0200 |
commit | 832fbd94c0e9de98d26cc8a939f1e537b8cb00b8 (patch) | |
tree | b0a743684f44281e1e702b56674dd16ad2424d59 /tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |
parent | f2beee5185e0bf7f983fb97a34480b4c74d7eb8c (diff) | |
parent | b60a666df22cb9174bdc4506d71cbc9e8ba6b1c9 (diff) | |
download | wallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.tar.gz wallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.tar.zst wallabag-832fbd94c0e9de98d26cc8a939f1e537b8cb00b8.zip |
Merge pull request #3096 from aaa2000/fix-api-entries-pagination-with-perpage
Fix API pagination is broken if perPage is custom value
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 409a8291..63d70bd9 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -156,6 +156,22 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
156 | $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); | 156 | $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); |
157 | } | 157 | } |
158 | 158 | ||
159 | public function testGetEntriesOnPageTwo() | ||
160 | { | ||
161 | $this->client->request('GET', '/api/entries', [ | ||
162 | 'page' => 2, | ||
163 | 'perPage' => 2, | ||
164 | ]); | ||
165 | |||
166 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | ||
167 | |||
168 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
169 | |||
170 | $this->assertGreaterThanOrEqual(0, $content['total']); | ||
171 | $this->assertEquals(2, $content['page']); | ||
172 | $this->assertEquals(2, $content['limit']); | ||
173 | } | ||
174 | |||
159 | public function testGetStarredEntries() | 175 | public function testGetStarredEntries() |
160 | { | 176 | { |
161 | $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']); | 177 | $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']); |