public function testClearCache() { $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock(); $connection->expects($this->once())->method('selectRow')->will($this->returnValue(false)); $instance = new DataItemByIdFinder($connection, 'foo'); $instance->saveToCache(42, 'Foo#0##'); $instance->getDataItemForId(42); $instance->clear(); $instance->getDataItemForId(42); }
/** * 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->dataItemByIdFinder->clear(); }