/**
  * Creates a cache for testing
  *
  * @param string $name
  * @return VariableFrontend
  */
 protected function createCache($name)
 {
     $mockEnvironment = $this->getMock(\TYPO3\Flow\Utility\Environment::class, array(), array(), '', FALSE);
     $mockEnvironment->expects($this->any())->method('getMaximumPathLength')->will($this->returnValue(255));
     $mockEnvironment->expects($this->any())->method('getPathToTemporaryDirectory')->will($this->returnValue('vfs://Foo/'));
     $mockCacheManager = $this->getMock(\TYPO3\Flow\Cache\CacheManager::class, array(), array(), '', FALSE);
     $mockCacheManager->expects($this->any())->method('isCachePersistent')->will($this->returnValue(FALSE));
     $backend = new FileBackend(new ApplicationContext('Testing'));
     $backend->injectCacheManager($mockCacheManager);
     $backend->injectEnvironment($mockEnvironment);
     $cache = new VariableFrontend($name, $backend);
     $cache->initializeObject();
     $cache->flush();
     return $cache;
 }