aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-10-02 13:17:23 +0200
committerGitHub <noreply@github.com>2016-10-02 13:17:23 +0200
commit18b8dc0e9984fce01b231810347fef7d32c06ac7 (patch)
tree6ab63a4d9bc6e8ef85e274b61f6cc16e676bb5f9 /tests/Wallabag
parent92395680b6ac76a2776f3635803b5de447014b11 (diff)
parent3583cadf6fc4e5d2b410a42c874bb9a94e505390 (diff)
downloadwallabag-18b8dc0e9984fce01b231810347fef7d32c06ac7.tar.gz
wallabag-18b8dc0e9984fce01b231810347fef7d32c06ac7.tar.zst
wallabag-18b8dc0e9984fce01b231810347fef7d32c06ac7.zip
Merge pull request #2325 from wallabag/api-entries-exists
Add an exists endpoint in API
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
index 101c20eb..9b5760bc 100644
--- a/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php
@@ -684,4 +684,26 @@ class WallabagRestControllerTest extends WallabagApiTestCase
684 684
685 $this->assertEquals(true, $content['is_starred']); 685 $this->assertEquals(true, $content['is_starred']);
686 } 686 }
687
688 public function testGetEntriesExists()
689 {
690 $this->client->request('GET', '/api/entries/exists?url=http://0.0.0.0/entry2');
691
692 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
693
694 $content = json_decode($this->client->getResponse()->getContent(), true);
695
696 $this->assertEquals(true, $content['exists']);
697 }
698
699 public function testGetEntriesExistsWhichDoesNotExists()
700 {
701 $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
702
703 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
704
705 $content = json_decode($this->client->getResponse()->getContent(), true);
706
707 $this->assertEquals(false, $content['exists']);
708 }
687} 709}