aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Tests
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2015-08-20 21:51:02 +0200
committerNicolas Lœuillet <nicolas@loeuillet.org>2015-08-20 21:51:02 +0200
commit109d67dbb16478f927c3d6a46ab61ea9994aafae (patch)
tree0786b588729e3fd474a08b68ce288078e4354cfa /src/Wallabag/ApiBundle/Tests
parent4fcb7eaf139a4d2cbd0f54574e6c51a0fe852ef1 (diff)
parent6682139ec50e29308953a50dcbd088e6d8a07e81 (diff)
downloadwallabag-109d67dbb16478f927c3d6a46ab61ea9994aafae.tar.gz
wallabag-109d67dbb16478f927c3d6a46ab61ea9994aafae.tar.zst
wallabag-109d67dbb16478f927c3d6a46ab61ea9994aafae.zip
Merge pull request #1386 from wallabag/v2-refactor
WIP – Fixing things around :dash:
Diffstat (limited to 'src/Wallabag/ApiBundle/Tests')
-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());