/**
  * @return RequestOptionsProcessor
  */
 private function getRequestOptionsProcessor()
 {
     // We want a cached instance here
     if ($this->requestOptionsProcessor === null) {
         $this->requestOptionsProcessor = $this->factory->newRequestOptionsProcessor();
     }
     return $this->requestOptionsProcessor;
 }
 public function testCanConstructCachedListLookup()
 {
     $instance = new SQLStoreFactory($this->store);
     $listLookup = $this->getMockBuilder('\\SMW\\SQLStore\\ListLookup')->disableOriginalConstructor()->getMock();
     $this->assertInstanceOf('SMW\\SQLStore\\ListLookup\\CachedListLookup', $instance->newCachedListLookup($listLookup, true, 42));
 }
示例#3
0
 /**
  * Return status of the concept cache for the given concept as an array
  * with key 'status' ('empty': not cached, 'full': cached, 'no': not
  * cachable). If status is not 'no', the array also contains keys 'size'
  * (query size), 'depth' (query depth), 'features' (query features). If
  * status is 'full', the array also contains keys 'date' (timestamp of
  * cache), 'count' (number of results in cache).
  *
  * @since 1.8
  * @param Title|SMWWikiPageValue $concept
  *
  * @return DIConcept|null
  */
 public function getConceptCacheStatus($concept)
 {
     return $this->factory->newSlaveConceptCache()->getStatus($concept);
 }
 public function testCanConstrucCachedValueLookupStore()
 {
     $instance = new SQLStoreFactory($this->store);
     $this->assertInstanceOf('SMW\\SQLStore\\CachedValueLookupStore', $instance->newCachedValueLookupStore());
 }
 /**
  * @return EntityLookup
  */
 private function getEntityLookup()
 {
     if ($this->entityLookup === null) {
         $this->entityLookup = $this->factory->newEntityLookup();
     }
     return $this->entityLookup;
 }
 public function testCanConstructInstaller()
 {
     $connection = $this->getMockBuilder('\\DatabaseBase')->disableOriginalConstructor()->getMockForAbstractClass();
     $connection->expects($this->any())->method('getType')->will($this->returnValue('mysql'));
     $store = $this->getMockBuilder('\\SMW\\SQLStore\\SQLStore')->disableOriginalConstructor()->getMock();
     $store->expects($this->once())->method('getOptions')->will($this->returnValue(new Options()));
     $store->expects($this->once())->method('getConnection')->will($this->returnValue($connection));
     $instance = new SQLStoreFactory($store);
     $this->assertInstanceOf('SMW\\SQLStore\\Installer', $instance->newInstaller());
 }