eZ\Publish\Core\MVC\Symfony\CacheTests\Http\LocationAwareStoreTest::testGetStalePath PHP Method

testGetStalePath() public method

public testGetStalePath ( )
    public function testGetStalePath()
    {
        // Generate the lock file to force using the stale cache dir
        $locationId = 123;
        $prefix = LocationAwareStore::LOCATION_CACHE_DIR . DIRECTORY_SEPARATOR . $locationId;
        $prefixStale = LocationAwareStore::LOCATION_STALE_CACHE_DIR . DIRECTORY_SEPARATOR . $locationId;
        $lockFile = $this->store->getLocationCacheLockName($locationId);
        file_put_contents($lockFile, getmypid());
        $path = $this->store->getPath($prefix . DIRECTORY_SEPARATOR . 'en' . sha1('someContent'));
        $this->assertTrue(strpos($path, __DIR__ . DIRECTORY_SEPARATOR . $prefixStale) === 0);
        @unlink($lockFile);
    }