public function testNullForUnknownId() { $connection = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock(); $connection->expects($this->once())->method('selectRow')->will($this->returnValue(false)); $instance = new DataItemByIdFinder($connection, 'foo'); $this->assertNull($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(); }