public function testgetMaxIdForCategoryNamespace() { $database = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock(); $database->expects($this->once())->method('selectField')->with($this->equalTo('category'), $this->anything(), $this->anything(), $this->anything())->will($this->returnValue(1111)); $instance = new TitleLookup($database); $this->assertEquals(1111, $instance->setNamespace(NS_CATEGORY)->getMaxId()); }
protected function createMultipleConcepts() { $titleLookup = new TitleLookup($this->store->getConnection('mw.db')); $titleLookup->setNamespace(SMW_NS_CONCEPT); if ($this->endId == 0 && $this->startId == 0) { return $titleLookup->selectAll(); } $endId = $titleLookup->getMaxId(); if ($this->endId > 0) { $endId = min($this->endId, $endId); } return $titleLookup->selectByIdRange($this->startId, $endId); }
protected function getPagesFromFilters() { $pages = array(); $titleLookup = new TitleLookup($this->store->getConnection('mw.db')); foreach ($this->filters as $namespace) { $pages = array_merge($pages, $titleLookup->setNamespace($namespace)->selectAll()); } return $pages; }