aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php')
-rw-r--r--src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
index 86c8de1e..7ae54b57 100644
--- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -170,6 +170,31 @@ class WallabagRestControllerTest extends WebTestCase
170 $client = $this->createClient(); 170 $client = $this->createClient();
171 $headers = $this->generateHeaders('admin', 'mypassword'); 171 $headers = $this->generateHeaders('admin', 'mypassword');
172 172
173 $client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'), array(), $headers);
174
175 $this->assertEquals(200, $client->getResponse()->getStatusCode());
176
177 $content = json_decode($client->getResponse()->getContent(), true);
178
179 $this->assertGreaterThanOrEqual(1, count($content));
180 $this->assertNotEmpty($content['_embedded']['items']);
181 $this->assertGreaterThanOrEqual(1, $content['total']);
182 $this->assertEquals(1, $content['page']);
183 $this->assertGreaterThanOrEqual(1, $content['pages']);
184
185 $this->assertTrue(
186 $client->getResponse()->headers->contains(
187 'Content-Type',
188 'application/json'
189 )
190 );
191 }
192
193 public function testGetArchiveEntries()
194 {
195 $client = $this->createClient();
196 $headers = $this->generateHeaders('admin', 'mypassword');
197
173 $client->request('GET', '/api/entries', array('archive' => 1), array(), $headers); 198 $client->request('GET', '/api/entries', array('archive' => 1), array(), $headers);
174 199
175 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 200 $this->assertEquals(200, $client->getResponse()->getStatusCode());