From 816ad4051baa401e46b42121e6813345a8030032 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 8 Feb 2016 22:00:38 +0100 Subject: add more properties for entries #1634 --- .../Controller/WallabagRestControllerTest.php | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/Wallabag/ApiBundle/Tests/Controller') 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 $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 testPostEntryWithContent() + { + $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', + 'content' => 'This is a new content for my entry', + )); + + $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('This is a new content for my entry', $content['content']); + } + public function testPatchEntry() { $entry = $this->client->getContainer() -- cgit v1.2.3 From fba9e7d44d5987a603add50dc450f50079340dcc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 4 Mar 2016 11:40:48 +0100 Subject: Remove 'content' from API Waiting to find a good solution to avoid side problem since user can no define the content --- .../Tests/Controller/WallabagRestControllerTest.php | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/Wallabag/ApiBundle/Tests/Controller') diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php index 6e64d84f..630b75bf 100644 --- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php @@ -180,22 +180,6 @@ class WallabagRestControllerTest extends WallabagApiTestCase $this->assertEquals(false, $content['is_starred']); } - public function testPostEntryWithContent() - { - $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', - 'content' => 'This is a new content for my entry', - )); - - $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('This is a new content for my entry', $content['content']); - } - public function testPatchEntry() { $entry = $this->client->getContainer() -- cgit v1.2.3