Neos\Media\Tests\Functional\AbstractTest::getMockResourceByImagePath PHP Method

getMockResourceByImagePath() protected method

Creates an Image object from a file using a mock resource (in order to avoid a database resource pointer entry)
protected getMockResourceByImagePath ( string $imagePathAndFilename ) : PersistentResource
$imagePathAndFilename string
return Neos\Flow\ResourceManagement\PersistentResource
    protected function getMockResourceByImagePath($imagePathAndFilename)
    {
        $imagePathAndFilename = Files::getUnixStylePath($imagePathAndFilename);
        $hash = sha1_file($imagePathAndFilename);
        copy($imagePathAndFilename, 'resource://' . $hash);
        return $mockResource = $this->createMockResourceAndPointerFromHash($hash);
    }