public function testClearCache()
 {
     $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock();
     $connection->expects($this->once())->method('selectRow')->will($this->returnValue(false));
     $instance = new IdToDataItemMatchFinder($connection, $this->iteratorFactory);
     $instance->saveToCache(42, 'Foo#0##');
     $instance->getDataItemById(42);
     $instance->clear();
     $instance->getDataItemById(42);
 }
예제 #2
0
 /**
  * Delete all cached information.
  *
  * @since 1.8
  */
 public function clearCaches()
 {
     $this->prop_ids = array();
     $this->prop_sortkeys = array();
     $this->regular_ids = array();
     $this->regular_sortkeys = array();
     $this->idToDataItemMatchFinder->clear();
 }