public function testThrowsExceptionWhenItFailsToGenerateUniqueImageIdentifier()
{
$imagePath = FIXTURES_DIR . '/image.png';
$imageData = file_get_contents($imagePath);
$this->request->expects($this->once())->method('getContent')->will($this->returnValue($imageData));
$this->database->expects($this->any())->method('imageExists')->will($this->returnValue(true));
$this->headers->expects($this->once())->method('set')->with('Retry-After', 1);
$this->prepare->prepareImage($this->event);
}