+ public function testGetEntriesExistsWithManyUrlsHashed()
+ {
+ $url1 = 'http://0.0.0.0/entry2';
+ $url2 = 'http://0.0.0.0/entry10';
+ $this->client->request('GET', '/api/entries/exists?hashedurls[]='.hash('md5',$url1).'&hashedurls[]='.hash('md5',$url2) . '&return_id=1');
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertArrayHasKey($url1, $content);
+ $this->assertArrayHasKey($url2, $content);
+ $this->assertSame(2, $content[$url1]);
+ $this->assertNull($content[$url2]);
+
+ $this->assertArrayHasKey(hash('md5', $url1), $content);
+ $this->assertArrayHasKey(hash('md5', $url2), $content);
+ $this->assertEquals(2, $content[hash('md5', $url1)]);
+ $this->assertEquals(false, $content[hash('md5', $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?hashedurls[]='.hash('md5',$url1).'&hashedurls[]='.hash('md5',$url2));
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertArrayHasKey($url1, $content);
+ $this->assertArrayHasKey($url2, $content);
+ $this->assertTrue($content[$url1]);
+ $this->assertFalse($content[$url2]);
+ }
+