diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2019-05-21 11:18:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 11:18:19 +0200 |
commit | a2b5d67560341011e791b678422578ab8d6b1e3f (patch) | |
tree | bfe5a7d8f3d8cfbbe8131d8ee6ade29dfea88853 /tests | |
parent | b8b37ccdea6b453aa228cb79755752b5738b98b9 (diff) | |
parent | 2c290747cb0d235392f6e5d22205a706c6474168 (diff) | |
download | wallabag-a2b5d67560341011e791b678422578ab8d6b1e3f.tar.gz wallabag-a2b5d67560341011e791b678422578ab8d6b1e3f.tar.zst wallabag-a2b5d67560341011e791b678422578ab8d6b1e3f.zip |
Merge pull request #3960 from wallabag/api-entries-2817
api/entries: add parameter detail to exclude or include content in response
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 8cc12ed3..8b7898ee 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -133,6 +133,27 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
133 | $this->assertSame(1, $content['page']); | 133 | $this->assertSame(1, $content['page']); |
134 | $this->assertGreaterThanOrEqual(1, $content['pages']); | 134 | $this->assertGreaterThanOrEqual(1, $content['pages']); |
135 | 135 | ||
136 | $this->assertNotNull($content['_embedded']['items'][0]['content']); | ||
137 | |||
138 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); | ||
139 | } | ||
140 | |||
141 | public function testGetEntriesDetailMetadata() | ||
142 | { | ||
143 | $this->client->request('GET', '/api/entries?detail=metadata'); | ||
144 | |||
145 | $this->assertSame(200, $this->client->getResponse()->getStatusCode()); | ||
146 | |||
147 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
148 | |||
149 | $this->assertGreaterThanOrEqual(1, \count($content)); | ||
150 | $this->assertNotEmpty($content['_embedded']['items']); | ||
151 | $this->assertGreaterThanOrEqual(1, $content['total']); | ||
152 | $this->assertSame(1, $content['page']); | ||
153 | $this->assertGreaterThanOrEqual(1, $content['pages']); | ||
154 | |||
155 | $this->assertNull($content['_embedded']['items'][0]['content']); | ||
156 | |||
136 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); | 157 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type')); |
137 | } | 158 | } |
138 | 159 | ||