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)); }
/** * @since 2.1 * * @param integer $id * * @return DIWikiPage|null */ public function getDataItemForId($id) { return $this->dataItemByIdFinder->getDataItemForId($id); }