eZ\Publish\Core\MVC\Symfony\Cache\Http\LocationAwareStore::getLocationCacheLockName PHP Method

getLocationCacheLockName() public method

This method is public only for unit tests. Use it only if you know what you are doing.
public getLocationCacheLockName ( $locationId = null ) : string
return string
    public function getLocationCacheLockName($locationId = null)
    {
        $locationId = $locationId ?: 'all';
        return "{$this->root}/_ezloc_{$locationId}.purging";
    }

Usage Example

 public function testPurgeAllContentByRequestBC()
 {
     $fs = $this->getFilesystemMock();
     $this->store->setFilesystem($fs);
     $locationCacheDir = $this->store->getLocationCacheDir();
     $staleCacheDir = str_replace(LocationAwareStore::LOCATION_CACHE_DIR, LocationAwareStore::LOCATION_STALE_CACHE_DIR, $locationCacheDir);
     $fs->expects($this->any())->method('exists')->with($locationCacheDir)->will($this->returnValue(true));
     $fs->expects($this->once())->method('mkdir')->with($staleCacheDir);
     $fs->expects($this->once())->method('mirror')->with($locationCacheDir, $staleCacheDir);
     $fs->expects($this->once())->method('remove')->with(array($staleCacheDir, $this->store->getLocationCacheLockName(), $locationCacheDir));
     $request = Request::create('/', 'PURGE');
     $request->headers->set('X-Location-Id', '*');
     $this->store->purgeByRequest($request);
 }