本文整理汇总了PHP中TYPO3\Flow\Cache\Frontend\VariableFrontend::initializeObject方法的典型用法代码示例。如果您正苦于以下问题:PHP VariableFrontend::initializeObject方法的具体用法?PHP VariableFrontend::initializeObject怎么用?PHP VariableFrontend::initializeObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Cache\Frontend\VariableFrontend
的用法示例。
在下文中一共展示了VariableFrontend::initializeObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createCache
/**
* 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;
}