ImboUnitTest\Storage\FilesystemTest::testGetImagePath PHP Method

testGetImagePath() public method

public testGetImagePath ( )
    public function testGetImagePath()
    {
        $driver = new Filesystem(['dataDir' => DIRECTORY_SEPARATOR . 'tmp']);
        $reflection = new \ReflectionClass($driver);
        $method = $reflection->getMethod('getImagePath');
        $method->setAccessible(true);
        $expectedFullPath = '/tmp/5/9/6/59632bc7a908b9cd47a35d03fc992aa7/9/6/d/96d08a5943ebf1c5635a2995c9408cdd.png';
        $expectedDirPath = dirname($expectedFullPath);
        if (DIRECTORY_SEPARATOR != '/') {
            $expectedFullPath = str_replace('/', DIRECTORY_SEPARATOR, $expectedFullPath);
            $expectedDirPath = str_replace('/', DIRECTORY_SEPARATOR, $expectedDirPath);
        }
        $this->assertSame($expectedFullPath, $method->invoke($driver, $this->user, $this->imageIdentifier));
        $this->assertSame($expectedDirPath, $method->invoke($driver, $this->user, $this->imageIdentifier, false));
    }