aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Tests')
-rw-r--r--src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
index 22894a77..6e64d84f 100644
--- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -162,6 +162,40 @@ class WallabagRestControllerTest extends WallabagApiTestCase
162 $this->assertCount(1, $content['tags']); 162 $this->assertCount(1, $content['tags']);
163 } 163 }
164 164
165 public function testPostArchivedEntry()
166 {
167 $this->client->request('POST', '/api/entries.json', array(
168 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
169 'archive' => true,
170 'starred' => false,
171 ));
172
173 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
174
175 $content = json_decode($this->client->getResponse()->getContent(), true);
176
177 $this->assertGreaterThan(0, $content['id']);
178 $this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
179 $this->assertEquals(true, $content['is_archived']);
180 $this->assertEquals(false, $content['is_starred']);
181 }
182
183 public function testPostEntryWithContent()
184 {
185 $this->client->request('POST', '/api/entries.json', array(
186 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
187 'content' => 'This is a new content for my entry',
188 ));
189
190 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
191
192 $content = json_decode($this->client->getResponse()->getContent(), true);
193
194 $this->assertGreaterThan(0, $content['id']);
195 $this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
196 $this->assertEquals('This is a new content for my entry', $content['content']);
197 }
198
165 public function testPatchEntry() 199 public function testPatchEntry()
166 { 200 {
167 $entry = $this->client->getContainer() 201 $entry = $this->client->getContainer()