forked from wallabag/wallabag
Fix typo & add test
This commit is contained in:
@ -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()
|
||||||
|
|||||||
@ -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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user