protected function getMockResourceByImagePath($imagePathAndFilename)
{
$imagePathAndFilename = Files::getUnixStylePath($imagePathAndFilename);
$hash = sha1_file($imagePathAndFilename);
copy($imagePathAndFilename, 'resource://' . $hash);
return $mockResource = $this->createMockResourceAndPointerFromHash($hash);
}