X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FTests%2FController%2FWallabagRestControllerTest.php;h=630b75bfe62adb2bbd21d387635e8613a027a587;hb=fba9e7d44d5987a603add50dc450f50079340dcc;hp=22894a77f756e6ededda60123699abeb30b80b21;hpb=dad1c546a521159ca65a5a7649651d37728f0e55;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php index 22894a77..630b75bf 100644 --- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php @@ -162,6 +162,24 @@ class WallabagRestControllerTest extends WallabagApiTestCase $this->assertCount(1, $content['tags']); } + public function testPostArchivedEntry() + { + $this->client->request('POST', '/api/entries.json', array( + 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', + 'archive' => true, + 'starred' => false, + )); + + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); + + $content = json_decode($this->client->getResponse()->getContent(), true); + + $this->assertGreaterThan(0, $content['id']); + $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']); + $this->assertEquals(true, $content['is_archived']); + $this->assertEquals(false, $content['is_starred']); + } + public function testPatchEntry() { $entry = $this->client->getContainer()