aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index 34de8ec8..8cc12ed3 100644
--- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
@@ -1077,6 +1077,17 @@ class EntryRestControllerTest extends WallabagApiTestCase
1077 1077
1078 public function testGetEntriesExistsWhichDoesNotExists() 1078 public function testGetEntriesExistsWhichDoesNotExists()
1079 { 1079 {
1080 $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
1081
1082 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
1083
1084 $content = json_decode($this->client->getResponse()->getContent(), true);
1085
1086 $this->assertFalse($content['exists']);
1087 }
1088
1089 public function testGetEntriesExistsWhichDoesNotExistsWithHashedUrl()
1090 {
1080 $this->client->request('GET', '/api/entries/exists?hashed_url=' . hash('sha1', 'http://google.com/entry2')); 1091 $this->client->request('GET', '/api/entries/exists?hashed_url=' . hash('sha1', 'http://google.com/entry2'));
1081 1092
1082 $this->assertSame(200, $this->client->getResponse()->getStatusCode()); 1093 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
@@ -1088,6 +1099,13 @@ class EntryRestControllerTest extends WallabagApiTestCase
1088 1099
1089 public function testGetEntriesExistsWithNoUrl() 1100 public function testGetEntriesExistsWithNoUrl()
1090 { 1101 {
1102 $this->client->request('GET', '/api/entries/exists?url=');
1103
1104 $this->assertSame(403, $this->client->getResponse()->getStatusCode());
1105 }
1106
1107 public function testGetEntriesExistsWithNoHashedUrl()
1108 {
1091 $this->client->request('GET', '/api/entries/exists?hashed_url='); 1109 $this->client->request('GET', '/api/entries/exists?hashed_url=');
1092 1110
1093 $this->assertSame(403, $this->client->getResponse()->getStatusCode()); 1111 $this->assertSame(403, $this->client->getResponse()->getStatusCode());