]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Remove 'content' from API 1754/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 4 Mar 2016 10:40:48 +0000 (11:40 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Fri, 4 Mar 2016 10:46:18 +0000 (11:46 +0100)
Waiting to find a good solution to avoid side problem since user can no define the content

src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php

index 28145e45081bc957670049e16b4a73b1f0fc5ad1..35a90edde12bee3bc8b923edda9fa7311a4ff963 100644 (file)
@@ -99,7 +99,6 @@ class WallabagRestController extends FOSRestController
      *          {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
      *          {"name"="starred", "dataType"="boolean", "required"=false, "format"="true or false", "description"="entry already starred"},
      *          {"name"="archive", "dataType"="boolean", "required"=false, "format"="true or false", "description"="entry already archived"},
-     *          {"name"="content", "dataType"="string", "required"=false, "format"="content", "description"="content you want to pass directly"},
      *       }
      * )
      *
@@ -110,7 +109,6 @@ class WallabagRestController extends FOSRestController
         $this->validateAuthentication();
 
         $url = $request->request->get('url');
-        $content = $request->request->get('content');
         $isArchived = $request->request->get('archive');
         $isStarred = $request->request->get('starred');
 
@@ -132,10 +130,6 @@ class WallabagRestController extends FOSRestController
             $entry->setArchived(true);
         }
 
-        if (!empty($content)) {
-            $entry->setContent($content);
-        }
-
         $em = $this->getDoctrine()->getManager();
         $em->persist($entry);
 
index 6e64d84f7d95d07f5a5af571090f6df211e33b29..630b75bfe62adb2bbd21d387635e8613a027a587 100644 (file)
@@ -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()