1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Merge pull request #2325 from wallabag/api-entries-exists

Add an exists endpoint in API
This commit is contained in:
Nicolas Lœuillet 2016-10-02 13:17:23 +02:00 committed by GitHub
commit 18b8dc0e99
2 changed files with 54 additions and 0 deletions

View file

@ -684,4 +684,26 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->assertEquals(true, $content['is_starred']);
}
public function testGetEntriesExists()
{
$this->client->request('GET', '/api/entries/exists?url=http://0.0.0.0/entry2');
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals(true, $content['exists']);
}
public function testGetEntriesExistsWhichDoesNotExists()
{
$this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals(false, $content['exists']);
}
}