]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
Merge pull request #3095 from aaa2000/api-error-on-fail-fetch-content
[github/wallabag/wallabag.git] / tests / Wallabag / ApiBundle / Controller / EntryRestControllerTest.php
index deafd1fab70513dfad35c06a2ca8819897431646..0a65f9cee0628a78a38ab6b2fd7ce259c1383371 100644 (file)
@@ -157,6 +157,22 @@ class EntryRestControllerTest extends WallabagApiTestCase
         $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
     }
 
+    public function testGetEntriesOnPageTwo()
+    {
+        $this->client->request('GET', '/api/entries', [
+            'page' => 2,
+            'perPage' => 2,
+        ]);
+
+        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
+
+        $content = json_decode($this->client->getResponse()->getContent(), true);
+
+        $this->assertGreaterThanOrEqual(0, $content['total']);
+        $this->assertEquals(2, $content['page']);
+        $this->assertEquals(2, $content['limit']);
+    }
+
     public function testGetStarredEntries()
     {
         $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);