diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-04-01 14:34:20 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-04-01 14:34:20 +0200 |
commit | c579ce2306297674c56376a2ab5c8ba66a272253 (patch) | |
tree | 03f8fdd7c7ee93fd0527d46f2690a81cf6d2d286 /tests/Wallabag/ApiBundle/Controller | |
parent | 8a6456629814039cfc623cdb279bcba06dacff50 (diff) | |
download | wallabag-c579ce2306297674c56376a2ab5c8ba66a272253.tar.gz wallabag-c579ce2306297674c56376a2ab5c8ba66a272253.tar.zst wallabag-c579ce2306297674c56376a2ab5c8ba66a272253.zip |
Some cleanup
Also, do not run the hashed_url migration into a Doctrine migration
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 18 |
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()); |