/**
  * @since 2.2
  *
  * @return ConceptCache
  */
 public function newMasterConceptCache()
 {
     $conceptQueryResolver = new ConceptQueryResolver($this->newMasterQueryEngine());
     $conceptQueryResolver->setConceptFeatures($GLOBALS['smwgQConceptFeatures']);
     $conceptCache = new ConceptCache($this->store, $conceptQueryResolver);
     $conceptCache->setUpperLimit($GLOBALS['smwgQMaxLimit']);
     return $conceptCache;
 }
Ejemplo n.º 2
0
 public function testDeleteConceptCache()
 {
     $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock();
     $connection->expects($this->any())->method('selectRow')->will($this->returnValue(false));
     $connection->expects($this->once())->method('delete');
     $connectionManager = $this->getMockBuilder('\\SMW\\ConnectionManager')->disableOriginalConstructor()->getMock();
     $connectionManager->expects($this->atLeastOnce())->method('getConnection')->will($this->returnValue($connection));
     $store = new \SMWSQLStore3();
     $store->setConnectionManager($connectionManager);
     $conceptQueryResolver = $this->getMockBuilder('\\SMW\\SQLStore\\QueryEngine\\ConceptQueryResolver')->disableOriginalConstructor()->getMock();
     $instance = new ConceptCache($store, $conceptQueryResolver);
     $instance->deleteConceptCache(Title::newFromText('Foo', SMW_NS_CONCEPT));
 }