+ public function testGetEntriesExistsWithManyUrlsHashed()
+ {
+ $url1 = 'http://0.0.0.0/entry2';
+ $url2 = 'http://0.0.0.0/entry10';
+ $this->client->request('GET', '/api/entries/exists?hashed_urls[]=' . hash('sha1', $url1) . '&hashed_urls[]=' . hash('sha1', $url2) . '&return_id=1');
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertArrayHasKey(hash('sha1', $url1), $content);
+ $this->assertArrayHasKey(hash('sha1', $url2), $content);
+ $this->assertSame(2, $content[hash('sha1', $url1)]);
+ $this->assertNull($content[hash('sha1', $url2)]);
+ }
+
+ public function testGetEntriesExistsWithManyUrlsHashedReturnBool()
+ {
+ $url1 = 'http://0.0.0.0/entry2';
+ $url2 = 'http://0.0.0.0/entry10';
+ $this->client->request('GET', '/api/entries/exists?hashed_urls[]=' . hash('sha1', $url1) . '&hashed_urls[]=' . hash('sha1', $url2));
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertArrayHasKey(hash('sha1', $url1), $content);
+ $this->assertArrayHasKey(hash('sha1', $url2), $content);
+ $this->assertTrue($content[hash('sha1', $url1)]);
+ $this->assertFalse($content[hash('sha1', $url2)]);
+ }
+