Пример #1
0
 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;
 }
Пример #2
0
 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);
 }
Пример #3
0
 public function testSelectByRangeOnMissingNamespaceThrowsException()
 {
     $this->setExpectedException('RuntimeException');
     $database = $this->getMockBuilder('\\SMW\\MediaWiki\\Database')->disableOriginalConstructor()->getMock();
     $instance = new TitleLookup($database);
     $instance->selectByIdRange(1, 5);
 }