本文整理汇总了PHP中Doctrine\Common\Cache\CacheProvider::method方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheProvider::method方法的具体用法?PHP CacheProvider::method怎么用?PHP CacheProvider::method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\Common\Cache\CacheProvider
的用法示例。
在下文中一共展示了CacheProvider::method方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* Initialize MetadataCollector.
*/
public function setUp()
{
$this->docLocator = $this->getMockBuilder('Sineflow\\ElasticsearchBundle\\Mapping\\DocumentLocator')->disableOriginalConstructor()->getMock();
$this->docLocator->method('getShortClassName')->willReturnArgument(0);
$this->docParser = $this->getMockBuilder('Sineflow\\ElasticsearchBundle\\Mapping\\DocumentParser')->disableOriginalConstructor()->getMock();
$this->cache = $this->getMockBuilder('Doctrine\\Common\\Cache\\FilesystemCache')->disableOriginalConstructor()->getMock();
$metadata = new DocumentMetadata(array('type' => 'foo', 'properties' => array('title' => array('null_value' => false, 'type' => 'boolean'), '_id' => array('type' => 'string'), '_score' => array('type' => 'float'), '_parent' => array('type' => 'string')), 'fields' => array('_all' => array('enabled' => true)), 'propertiesMetadata' => array('title' => array('propertyName' => 'title', 'type' => 'boolean', 'multilanguage' => null, 'propertyAccess' => 1), '_id' => array('propertyName' => 'id', 'type' => 'string', 'multilanguage' => null, 'propertyAccess' => 1), '_score' => array('propertyName' => 'score', 'type' => 'float', 'multilanguage' => null, 'propertyAccess' => 1), '_parent' => array('propertyName' => 'parent', 'type' => 'string', 'multilanguage' => null, 'propertyAccess' => 1)), 'objects' => array(0 => 'AppBundle\\ElasticSearch\\Document\\ObjSome', 1 => 'AppBundle\\ElasticSearch\\Document\\ObjOther'), 'repositoryClass' => null, 'className' => 'AppBundle\\ElasticSearch\\Document\\Foo', 'shortClassName' => 'TestBundle:Foo'));
$this->cache->method('fetch')->willReturn(['foo' => ['TestBundle:Foo' => $metadata]]);
$indexManagers = ['test' => ['name' => 'testname', 'connection' => 'test1', 'use_aliases' => false, 'settings' => ['refresh_interval' => 2, 'number_of_replicas' => 3, 'analysis' => ['filter' => ['test_filter' => ['type' => 'nGram']], 'tokenizer' => ['test_tokenizer' => ['type' => 'nGram']], 'analyzer' => ['test_analyzer' => ['type' => 'custom']]]], 'types' => ['TestBundle:Foo', 'TestBundle:Bar']]];
$this->metadataCollector = new DocumentMetadataCollector($indexManagers, $this->docLocator, $this->docParser, $this->cache);
}