Fix typo & add test

This commit is contained in:
Jeremy Benoist 2016-10-05 19:30:56 +02:00
parent 5d39243068
commit 0b174d69d7
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
2 changed files with 8 additions and 1 deletions

View file

@ -40,7 +40,7 @@ class WallabagRestController extends FOSRestController
$url = $request->query->get('url', ''); $url = $request->query->get('url', '');
if (empty($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() $res = $this->getDoctrine()

View file

@ -804,4 +804,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->assertEquals(false, $content['exists']); $this->assertEquals(false, $content['exists']);
} }
public function testGetEntriesExistsWithNoUrl()
{
$this->client->request('GET', '/api/entries/exists?url=');
$this->assertEquals(403, $this->client->getResponse()->getStatusCode());
}
} }