mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Ability to check multiple urls in API
This commit is contained in:
parent
233a1081ea
commit
f0abc22d09
2 changed files with 37 additions and 1 deletions
|
@ -794,6 +794,22 @@ class WallabagRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertEquals(true, $content['exists']);
|
||||
}
|
||||
|
||||
public function testGetEntriesExistsWithManyUrls()
|
||||
{
|
||||
$url1 = 'http://0.0.0.0/entry2';
|
||||
$url2 = 'http://0.0.0.0/entry10';
|
||||
$this->client->request('GET', '/api/entries/exists?urls[]='.$url1.'&urls[]='.$url2);
|
||||
|
||||
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertArrayHasKey($url1, $content);
|
||||
$this->assertArrayHasKey($url2, $content);
|
||||
$this->assertEquals(true, $content[$url1]);
|
||||
$this->assertEquals(false, $content[$url2]);
|
||||
}
|
||||
|
||||
public function testGetEntriesExistsWhichDoesNotExists()
|
||||
{
|
||||
$this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue