aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-10-07 20:37:01 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-07 20:37:01 +0200
commitf0abc22d09d2e38d3dd408425821a89da3d21377 (patch)
tree7c25b888d8ea19b4725c3dd9b63da0a57419df1c /tests
parent233a1081eaab7bb4a157015c33755a66afbdb922 (diff)
downloadwallabag-f0abc22d09d2e38d3dd408425821a89da3d21377.tar.gz
wallabag-f0abc22d09d2e38d3dd408425821a89da3d21377.tar.zst
wallabag-f0abc22d09d2e38d3dd408425821a89da3d21377.zip
Ability to check multiple urls in API
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
index 65b65290..4f16e70f 100644
--- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
@@ -794,6 +794,22 @@ class WallabagRestControllerTest extends WallabagApiTestCase
794 $this->assertEquals(true, $content['exists']); 794 $this->assertEquals(true, $content['exists']);
795 } 795 }
796 796
797 public function testGetEntriesExistsWithManyUrls()
798 {
799 $url1 = 'http://0.0.0.0/entry2';
800 $url2 = 'http://0.0.0.0/entry10';
801 $this->client->request('GET', '/api/entries/exists?urls[]='.$url1.'&urls[]='.$url2);
802
803 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
804
805 $content = json_decode($this->client->getResponse()->getContent(), true);
806
807 $this->assertArrayHasKey($url1, $content);
808 $this->assertArrayHasKey($url2, $content);
809 $this->assertEquals(true, $content[$url1]);
810 $this->assertEquals(false, $content[$url2]);
811 }
812
797 public function testGetEntriesExistsWhichDoesNotExists() 813 public function testGetEntriesExistsWhichDoesNotExists()
798 { 814 {
799 $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2'); 815 $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');