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:
commit
18b8dc0e99
2 changed files with 54 additions and 0 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue