]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge remote-tracking branch 'origin/master' into 2.3
authorJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 9 May 2017 11:55:31 +0000 (13:55 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 9 May 2017 11:55:31 +0000 (13:55 +0200)
1  2 
docs/de/user/upgrade.rst
docs/en/user/upgrade.rst
docs/fr/user/upgrade.rst
docs/it/user/installation.rst
docs/it/user/upgrade.rst
src/Wallabag/ApiBundle/Controller/EntryRestController.php
tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php

diff --combined docs/de/user/upgrade.rst
index af3b96fba26f596809e674a12916d95f5b73c160,76faa4e26c31004cc1429751b2b96e6c0905bc64..fa2aac451b653c8522d730a1f956e146ec390f8a
@@@ -61,9 -61,9 +61,9 @@@ Lade das letzte Release von wallabag he
  
  .. code-block:: bash
  
-     wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
+     wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
  
 -Du findest den `aktuellen MD5-Hash auf unserer Webseite <https://www.wallabag.org/pages/download-wallabag.html>`_.
 +Du findest den `aktuellen MD5-Hash auf unserer Webseite <https://static.wallabag.org/releases/>`_.
  
  Extrahiere das Archiv in deinen wallabag-Ordner und ersetze die ``app/config/parameters.yml`` mit deiner.
  
diff --combined docs/en/user/upgrade.rst
index 359a355f3139e2b32580b630759920cfe74243e7,46b490c32a747afe2c5fa6f2847ce30dca345dce..3157684cb7beb9d870b522be6924da3e90e1e72a
@@@ -65,9 -65,9 +65,9 @@@ Download the last release of wallabag
  
  .. code-block:: bash
  
-     wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
+     wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
  
 -You will find the `md5 hash of the latest package on our website <https://www.wallabag.org/pages/download-wallabag.html>`_.
 +You will find the `md5 hash of the latest package on our website <https://static.wallabag.org/releases/>`_.
  
  Extract the archive in your wallabag folder and replace ``app/config/parameters.yml`` with yours.
  
diff --combined docs/fr/user/upgrade.rst
index 5bb42deba48b77f39ca3de351439fa03c2db94da,af97ebb22957d7634da5a2aedd1e0c9a08fb8159..af1980061b824c8da153c7dd607da85887b7abe2
@@@ -61,9 -61,9 +61,9 @@@ Téléchargez la dernière version de w
  
  .. code-block:: bash
  
-     wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
+     wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
  
 -Vous trouverez `le hash md5 du dernier package sur notre site <https://www.wallabag.org/pages/download-wallabag.html>`_.
 +Vous trouverez `le hash md5 du dernier package sur notre site <https://static.wallabag.org/releases/>`_.
  
  Décompressez l'archive dans votre répertoire d'installation et remplacez le fichier ``app/config/parameters.yml`` avec le votre.
  
index c067228dff770cef4aa41f61e473ac3e56c4895c,95d781e661d5b82ca271ccefb4ee0b1d18181667..174507b8f36d0ed3c2fb9689d67c5e386b5ece5b
@@@ -86,9 -86,9 +86,9 @@@ Eseguite questo comando per scaricare e
  
  .. code-block:: bash
  
-    wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
+    wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
  
 -Troverete il `hash md5 del pacchetto piú aggiornato sul nostro sito <https://www.wallabag.org/pages/download-wallabag.html>`_.
 +Troverete il `hash md5 del pacchetto piú aggiornato sul nostro sito <https://static.wallabag.org/releases/>`_.
  
  Ora leggete la seguente documentazione per creare il vostro host virtuale poi accedete al vostro wallabag. Se avete cambiato la configurazione del database per usare MySQL o PostrgreSQL, dovrete creare un utente con il comando php bin/console wallabag:install --env=prod .
  
@@@ -103,13 -103,6 +103,13 @@@ Comando per avviare il containe
  
     docker pull wallabag/wallabag
  
 +Installazione su Cloudron
 +~~~~~~~~~~~~~~~~~~~~~~~~~
 +
 +Cloudron fornisce un modo facile di installare webapps sul vostro server mirato ad automatizzare i compiti del sysadmin ed a mantenere le app aggiornate.
 +wallabag é pacchettizzata come app Cloudron ed é disponibile all'installazione direttamente dallo store.
 +
 +`Installa wallabag sul tuo Cloudron <https://cloudron.io/store/org.wallabag.cloudronapp.html>`__
  
  Host virtuali
  -------------
diff --combined docs/it/user/upgrade.rst
index 52cd98c7f0face2d1bc769ff810b3a8dd967dc95,e1c3f0413f0b8b7f647d71da373c5a7a56485fdc..ede1a1a305fc1854d831ab31fb4894286d19e5dd
@@@ -78,9 -78,9 +78,9 @@@ Scaricate l'ultima versione di wallabag
  
  . code-block:: bash
  
-     wget http://wllbg.org/latest-v2-package && tar xvf latest-v2-package
+     wget https://wllbg.org/latest-v2-package && tar xvf latest-v2-package
  
 -Troverete il `hash md5 dell'ultima versione del pacchetto sul nostro sito <https://www.wallabag.org/pages/download-wallabag.html>`_.
 +Troverete il `hash md5 dell'ultima versione del pacchetto sul nostro sito <https://static.wallabag.org/releases/>`_.
  
  Estraete l'archivio nella vostra cartella di wallabag e rimpiazzate ``app/config/parameters.yml`` con il vostro.
  
@@@ -98,5 -98,5 +98,5 @@@ Da wallabag 1.
  Non esiste uno script automatico per aggiornare da wallabag 1.x a wallabag 2.x. Dovete:
  
  - esportare i vostri dati
 -- installare wallabag 2.x (leggete la documentazione a proposito dell'installazione *link mancante*) 
 +- installare wallabag 2.x (leggete la documentazione a proposito dell'installazione *link mancante*)
  - importate i dati in questa nuova installazione (leggete la documentazione a proposito dell'importazione)
index dbff606547c1e59ee96447046bee322d44c7bf35,c544815ebc7dee9bb308787940559ee376565af3..632b16d904d898a59b1421d60c713ee75f3f7c96
@@@ -5,7 -5,6 +5,7 @@@ namespace Wallabag\ApiBundle\Controller
  use Hateoas\Configuration\Route;
  use Hateoas\Representation\Factory\PagerfantaFactory;
  use Nelmio\ApiDocBundle\Annotation\ApiDoc;
 +use Symfony\Component\HttpKernel\Exception\HttpException;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpFoundation\JsonResponse;
  use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
@@@ -42,10 -41,12 +42,10 @@@ class EntryRestController extends Walla
                      ->getRepository('WallabagCoreBundle:Entry')
                      ->findByUrlAndUserId($url, $this->getUser()->getId());
  
 -                $results[$url] = false === $res ? false : true;
 +                $results[$url] = $res instanceof Entry ? $res->getId() : false;
              }
  
 -            $json = $this->get('serializer')->serialize($results, 'json');
 -
 -            return (new JsonResponse())->setJson($json);
 +            return $this->sendResponse($results);
          }
  
          // let's see if it is a simple url?
              ->getRepository('WallabagCoreBundle:Entry')
              ->findByUrlAndUserId($url, $this->getUser()->getId());
  
 -        $exists = false === $res ? false : true;
 -
 -        $json = $this->get('serializer')->serialize(['exists' => $exists], 'json');
 +        $exists = $res instanceof Entry ? $res->getId() : false;
  
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse(['exists' => $exists]);
      }
  
      /**
          $tags = $request->query->get('tags', '');
          $since = $request->query->get('since', 0);
  
+         /** @var \Pagerfanta\Pagerfanta $pager */
          $pager = $this->getDoctrine()
              ->getRepository('WallabagCoreBundle:Entry')
              ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags);
  
-         $pager->setCurrentPage($page);
          $pager->setMaxPerPage($perPage);
+         $pager->setCurrentPage($page);
  
          $pagerfantaFactory = new PagerfantaFactory('page', 'perPage');
          $paginatedCollection = $pagerfantaFactory->createRepresentation(
              )
          );
  
 -        $json = $this->get('serializer')->serialize($paginatedCollection, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($paginatedCollection);
      }
  
      /**
          $this->validateAuthentication();
          $this->validateUserAccess($entry->getUser()->getId());
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
              ->exportAs($request->attributes->get('_format'));
      }
  
 +    /**
 +     * Handles an entries list and delete URL.
 +     *
 +     * @ApiDoc(
 +     *       parameters={
 +     *          {"name"="urls", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]", "description"="Urls (as an array) to delete."}
 +     *       }
 +     * )
 +     *
 +     * @return JsonResponse
 +     */
 +    public function deleteEntriesListAction(Request $request)
 +    {
 +        $this->validateAuthentication();
 +
 +        $urls = json_decode($request->query->get('urls', []));
 +
 +        if (empty($urls)) {
 +            return $this->sendResponse([]);
 +        }
 +
 +        $results = [];
 +
 +        // handle multiple urls
 +        foreach ($urls as $key => $url) {
 +            $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
 +                $url,
 +                $this->getUser()->getId()
 +            );
 +
 +            $results[$key]['url'] = $url;
 +
 +            if (false !== $entry) {
 +                $em = $this->getDoctrine()->getManager();
 +                $em->remove($entry);
 +                $em->flush();
 +
 +                // entry deleted, dispatch event about it!
 +                $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
 +            }
 +
 +            $results[$key]['entry'] = $entry instanceof Entry ? true : false;
 +        }
 +
 +        return $this->sendResponse($results);
 +    }
 +
 +    /**
 +     * Handles an entries list and create URL.
 +     *
 +     * @ApiDoc(
 +     *       parameters={
 +     *          {"name"="urls", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]", "description"="Urls (as an array) to create."}
 +     *       }
 +     * )
 +     *
 +     * @return JsonResponse
 +     *
 +     * @throws HttpException When limit is reached
 +     */
 +    public function postEntriesListAction(Request $request)
 +    {
 +        $this->validateAuthentication();
 +
 +        $urls = json_decode($request->query->get('urls', []));
 +        $results = [];
 +
 +        $limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions');
 +
 +        if (count($urls) > $limit) {
 +            throw new HttpException(400, 'API limit reached');
 +        }
 +
 +        // handle multiple urls
 +        if (!empty($urls)) {
 +            foreach ($urls as $key => $url) {
 +                $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
 +                    $url,
 +                    $this->getUser()->getId()
 +                );
 +
 +                $results[$key]['url'] = $url;
 +
 +                if (false === $entry) {
 +                    $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
 +                        new Entry($this->getUser()),
 +                        $url
 +                    );
 +                }
 +
 +                $em = $this->getDoctrine()->getManager();
 +                $em->persist($entry);
 +                $em->flush();
 +
 +                $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
 +
 +                // entry saved, dispatch event about it!
 +                $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
 +            }
 +        }
 +
 +        return $this->sendResponse($results);
 +    }
 +
      /**
       * Create an entry.
       *
          // entry saved, dispatch event about it!
          $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
          $em = $this->getDoctrine()->getManager();
          $em->flush();
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
          // entry saved, dispatch event about it!
          $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry));
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
          // entry deleted, dispatch event about it!
          $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
          $this->validateAuthentication();
          $this->validateUserAccess($entry->getUser()->getId());
  
 -        $json = $this->get('serializer')->serialize($entry->getTags(), 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry->getTags());
      }
  
      /**
          $em->persist($entry);
          $em->flush();
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 -
 -        return (new JsonResponse())->setJson($json);
 +        return $this->sendResponse($entry);
      }
  
      /**
          $em->persist($entry);
          $em->flush();
  
 -        $json = $this->get('serializer')->serialize($entry, 'json');
 +        return $this->sendResponse($entry);
 +    }
 +
 +    /**
 +     * Handles an entries list delete tags from them.
 +     *
 +     * @ApiDoc(
 +     *       parameters={
 +     *          {"name"="list", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]", "description"="Urls (as an array) to handle."}
 +     *       }
 +     * )
 +     *
 +     * @return JsonResponse
 +     */
 +    public function deleteEntriesTagsListAction(Request $request)
 +    {
 +        $this->validateAuthentication();
 +
 +        $list = json_decode($request->query->get('list', []));
 +
 +        if (empty($list)) {
 +            return $this->sendResponse([]);
 +        }
 +
 +        // handle multiple urls
 +        $results = [];
 +
 +        foreach ($list as $key => $element) {
 +            $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
 +                $element->url,
 +                $this->getUser()->getId()
 +            );
 +
 +            $results[$key]['url'] = $element->url;
 +            $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
 +
 +            $tags = $element->tags;
 +
 +            if (false !== $entry && !(empty($tags))) {
 +                $tags = explode(',', $tags);
 +                foreach ($tags as $label) {
 +                    $label = trim($label);
 +
 +                    $tag = $this->getDoctrine()
 +                        ->getRepository('WallabagCoreBundle:Tag')
 +                        ->findOneByLabel($label);
 +
 +                    if (false !== $tag) {
 +                        $entry->removeTag($tag);
 +                    }
 +                }
 +
 +                $em = $this->getDoctrine()->getManager();
 +                $em->persist($entry);
 +                $em->flush();
 +            }
 +        }
 +
 +        return $this->sendResponse($results);
 +    }
 +
 +    /**
 +     * Handles an entries list and add tags to them.
 +     *
 +     * @ApiDoc(
 +     *       parameters={
 +     *          {"name"="list", "dataType"="string", "required"=true, "format"="A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]", "description"="Urls (as an array) to handle."}
 +     *       }
 +     * )
 +     *
 +     * @return JsonResponse
 +     */
 +    public function postEntriesTagsListAction(Request $request)
 +    {
 +        $this->validateAuthentication();
 +
 +        $list = json_decode($request->query->get('list', []));
 +
 +        if (empty($list)) {
 +            return $this->sendResponse([]);
 +        }
 +
 +        $results = [];
 +
 +        // handle multiple urls
 +        foreach ($list as $key => $element) {
 +            $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
 +                $element->url,
 +                $this->getUser()->getId()
 +            );
 +
 +            $results[$key]['url'] = $element->url;
 +            $results[$key]['entry'] = $entry instanceof Entry ? $entry->getId() : false;
 +
 +            $tags = $element->tags;
 +
 +            if (false !== $entry && !(empty($tags))) {
 +                $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
 +
 +                $em = $this->getDoctrine()->getManager();
 +                $em->persist($entry);
 +                $em->flush();
 +            }
 +        }
 +
 +        return $this->sendResponse($results);
 +    }
 +
 +    /**
 +     * Shortcut to send data serialized in json.
 +     *
 +     * @param mixed $data
 +     *
 +     * @return JsonResponse
 +     */
 +    private function sendResponse($data)
 +    {
 +        $json = $this->get('serializer')->serialize($data, 'json');
  
          return (new JsonResponse())->setJson($json);
      }
index 362c269b40544bf7541ee12720a354d23e201c73,63d70bd9bb3b1c2ef51f59a6e1c05921e0cd4c88..4f49f040f9e6d9ccfb4db6ef0e20fa0c7740b064
@@@ -156,6 -156,22 +156,22 @@@ class EntryRestControllerTest extends W
          $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
      }
  
+     public function testGetEntriesOnPageTwo()
+     {
+         $this->client->request('GET', '/api/entries', [
+             'page' => 2,
+             'perPage' => 2,
+         ]);
+         $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
+         $content = json_decode($this->client->getResponse()->getContent(), true);
+         $this->assertGreaterThanOrEqual(0, $content['total']);
+         $this->assertEquals(2, $content['page']);
+         $this->assertEquals(2, $content['limit']);
+     }
      public function testGetStarredEntries()
      {
          $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);
          $entry = $this->client->getContainer()
              ->get('doctrine.orm.entity_manager')
              ->getRepository('WallabagCoreBundle:Entry')
 -            ->findOneByUser(1);
 +            ->findOneByUser(1, ['id' => 'asc']);
  
          if (!$entry) {
              $this->markTestSkipped('No content found in db.');
          $this->assertEquals(false, $content['is_starred']);
          $this->assertEquals('New title for my article', $content['title']);
          $this->assertEquals(1, $content['user_id']);
 -        $this->assertCount(1, $content['tags']);
 +        $this->assertCount(2, $content['tags']);
      }
  
      public function testPostSameEntry()
          $this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
          $this->assertEquals(true, $content['is_archived']);
          $this->assertEquals(false, $content['is_starred']);
 -        $this->assertCount(2, $content['tags']);
 +        $this->assertCount(3, $content['tags']);
      }
  
      public function testPostArchivedAndStarredEntry()
  
          $content = json_decode($this->client->getResponse()->getContent(), true);
  
 -        $this->assertEquals(true, $content['exists']);
 +        $this->assertEquals(2, $content['exists']);
      }
  
      public function testGetEntriesExistsWithManyUrls()
  
          $this->assertArrayHasKey($url1, $content);
          $this->assertArrayHasKey($url2, $content);
 -        $this->assertEquals(true, $content[$url1]);
 +        $this->assertEquals(2, $content[$url1]);
          $this->assertEquals(false, $content[$url2]);
      }
  
  
          $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
      }
 +
 +    public function testPostEntriesTagsListAction()
 +    {
 +        $entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
 +            ->getRepository('WallabagCoreBundle:Entry')
 +            ->findByUrlAndUserId('http://0.0.0.0/entry4', 1);
 +
 +        $tags = $entry->getTags();
 +
 +        $this->assertCount(2, $tags);
 +
 +        $list = [
 +            [
 +                'url' => 'http://0.0.0.0/entry4',
 +                'tags' => 'new tag 1, new tag 2',
 +            ],
 +        ];
 +
 +        $this->client->request('POST', '/api/entries/tags/lists?list='.json_encode($list));
 +
 +        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
 +
 +        $content = json_decode($this->client->getResponse()->getContent(), true);
 +
 +        $this->assertInternalType('int', $content[0]['entry']);
 +        $this->assertEquals('http://0.0.0.0/entry4', $content[0]['url']);
 +
 +        $entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
 +            ->getRepository('WallabagCoreBundle:Entry')
 +            ->findByUrlAndUserId('http://0.0.0.0/entry4', 1);
 +
 +        $tags = $entry->getTags();
 +        $this->assertCount(4, $tags);
 +    }
 +
 +    public function testDeleteEntriesTagsListAction()
 +    {
 +        $entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
 +            ->getRepository('WallabagCoreBundle:Entry')
 +            ->findByUrlAndUserId('http://0.0.0.0/entry4', 1);
 +
 +        $tags = $entry->getTags();
 +
 +        $this->assertCount(4, $tags);
 +
 +        $list = [
 +            [
 +                'url' => 'http://0.0.0.0/entry4',
 +                'tags' => 'new tag 1, new tag 2',
 +            ],
 +        ];
 +
 +        $this->client->request('DELETE', '/api/entries/tags/list?list='.json_encode($list));
 +    }
 +
 +    public function testPostEntriesListAction()
 +    {
 +        $list = [
 +            'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
 +            'http://0.0.0.0/entry2',
 +        ];
 +
 +        $this->client->request('POST', '/api/entries/lists?urls='.json_encode($list));
 +
 +        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
 +
 +        $content = json_decode($this->client->getResponse()->getContent(), true);
 +
 +        $this->assertInternalType('int', $content[0]['entry']);
 +        $this->assertEquals('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']);
 +
 +        $this->assertInternalType('int', $content[1]['entry']);
 +        $this->assertEquals('http://0.0.0.0/entry2', $content[1]['url']);
 +    }
 +
 +    public function testDeleteEntriesListAction()
 +    {
 +        $list = [
 +            'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
 +            'http://0.0.0.0/entry3',
 +        ];
 +
 +        $this->client->request('DELETE', '/api/entries/list?urls='.json_encode($list));
 +
 +        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
 +
 +        $content = json_decode($this->client->getResponse()->getContent(), true);
 +
 +        $this->assertTrue($content[0]['entry']);
 +        $this->assertEquals('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']);
 +
 +        $this->assertFalse($content[1]['entry']);
 +        $this->assertEquals('http://0.0.0.0/entry3', $content[1]['url']);
 +    }
 +
 +    public function testLimitBulkAction()
 +    {
 +        $list = [
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +            'http://0.0.0.0/entry1',
 +        ];
 +
 +        $this->client->request('POST', '/api/entries/lists?urls='.json_encode($list));
 +
 +        $this->assertEquals(400, $this->client->getResponse()->getStatusCode());
 +        $this->assertContains('API limit reached', $this->client->getResponse()->getContent());
 +    }
  }