diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-10-08 13:31:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-08 13:31:31 +0200 |
commit | 4ad6f5878a7e7ab6359151b049fb49b9dd2c78ec (patch) | |
tree | fec55d3ed2c34c71ba6dbe6bc01f47773ef095f8 /tests/Wallabag | |
parent | e07c25a1adb2f89c5f57656e24a054ddd3a45df7 (diff) | |
parent | f0abc22d09d2e38d3dd408425821a89da3d21377 (diff) | |
download | wallabag-4ad6f5878a7e7ab6359151b049fb49b9dd2c78ec.tar.gz wallabag-4ad6f5878a7e7ab6359151b049fb49b9dd2c78ec.tar.zst wallabag-4ad6f5878a7e7ab6359151b049fb49b9dd2c78ec.zip |
Merge pull request #2393 from wallabag/api-urls-exist
Ability to check multiple urls in API
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php index c797daf7..5dcb3e00 100644 --- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php | |||
@@ -803,6 +803,22 @@ class WallabagRestControllerTest extends WallabagApiTestCase | |||
803 | $this->assertEquals(true, $content['exists']); | 803 | $this->assertEquals(true, $content['exists']); |
804 | } | 804 | } |
805 | 805 | ||
806 | public function testGetEntriesExistsWithManyUrls() | ||
807 | { | ||
808 | $url1 = 'http://0.0.0.0/entry2'; | ||
809 | $url2 = 'http://0.0.0.0/entry10'; | ||
810 | $this->client->request('GET', '/api/entries/exists?urls[]='.$url1.'&urls[]='.$url2); | ||
811 | |||
812 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); | ||
813 | |||
814 | $content = json_decode($this->client->getResponse()->getContent(), true); | ||
815 | |||
816 | $this->assertArrayHasKey($url1, $content); | ||
817 | $this->assertArrayHasKey($url2, $content); | ||
818 | $this->assertEquals(true, $content[$url1]); | ||
819 | $this->assertEquals(false, $content[$url2]); | ||
820 | } | ||
821 | |||
806 | public function testGetEntriesExistsWhichDoesNotExists() | 822 | public function testGetEntriesExistsWhichDoesNotExists() |
807 | { | 823 | { |
808 | $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2'); | 824 | $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2'); |