]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix typo & add test 2377/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 5 Oct 2016 17:30:56 +0000 (19:30 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Wed, 5 Oct 2016 17:30:56 +0000 (19:30 +0200)
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php

index b2c73932e07ccb68d1eb6944ca854daf90be9f74..a0d9d4f3a144336735468ad3fd4f04b67eda8087 100644 (file)
@@ -40,7 +40,7 @@ class WallabagRestController extends FOSRestController
         $url = $request->query->get('url', '');
 
         if (empty($url)) {
-            throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser->getId());
+            throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId());
         }
 
         $res = $this->getDoctrine()
index fd72b8f2234a31d9769f947ae32e2722cb460ecb..65b65290c2e83731c0e535b11f9ff673fa35406b 100644 (file)
@@ -804,4 +804,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
 
         $this->assertEquals(false, $content['exists']);
     }
+
+    public function testGetEntriesExistsWithNoUrl()
+    {
+        $this->client->request('GET', '/api/entries/exists?url=');
+
+        $this->assertEquals(403, $this->client->getResponse()->getStatusCode());
+    }
 }