diff options
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 3696f8f9..0b0c0276 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -242,6 +242,15 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
242 | $this->assertSame(2, $content['limit']); | 242 | $this->assertSame(2, $content['limit']); |
243 | } | 243 | } |
244 | 244 | ||
245 | public function testGetStarredEntriesWithBadSort() | ||
246 | { | ||
247 | $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated', 'order' => 'unknown']); | ||
248 | |||
249 | $this->assertSame(400, $this->client->getResponse()->getStatusCode()); | ||
250 | |||
251 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); | ||
252 | } | ||
253 | |||
245 | public function testGetStarredEntries() | 254 | public function testGetStarredEntries() |
246 | { | 255 | { |
247 | $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']); | 256 | $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']); |
@@ -785,7 +794,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
785 | $content = json_decode($this->client->getResponse()->getContent(), true); | 794 | $content = json_decode($this->client->getResponse()->getContent(), true); |
786 | 795 | ||
787 | $this->assertArrayHasKey('tags', $content); | 796 | $this->assertArrayHasKey('tags', $content); |
788 | $this->assertSame($nbTags + 3, \count($content['tags'])); | 797 | $this->assertCount($nbTags + 3, $content['tags']); |
789 | 798 | ||
790 | $entryDB = $this->client->getContainer() | 799 | $entryDB = $this->client->getContainer() |
791 | ->get('doctrine.orm.entity_manager') | 800 | ->get('doctrine.orm.entity_manager') |
@@ -825,7 +834,7 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
825 | $content = json_decode($this->client->getResponse()->getContent(), true); | 834 | $content = json_decode($this->client->getResponse()->getContent(), true); |
826 | 835 | ||
827 | $this->assertArrayHasKey('tags', $content); | 836 | $this->assertArrayHasKey('tags', $content); |
828 | $this->assertSame($nbTags - 1, \count($content['tags'])); | 837 | $this->assertCount($nbTags - 1, $content['tags']); |
829 | } | 838 | } |
830 | 839 | ||
831 | public function testSaveIsArchivedAfterPost() | 840 | public function testSaveIsArchivedAfterPost() |