public function testGetTitlesWithBackLinks()
 {
     $start = 1;
     $end = 10;
     $result = array('foo');
     $task = new BatchRefreshLinksForTemplate();
     $task->setStartAndEndBoundaries($start, $end);
     $title = $this->getMock('\\Title', ['getLinksFromBacklinkCache']);
     $title->expects($this->once())->method('getLinksFromBacklinkCache')->with(BatchRefreshLinksForTemplate::BACKLINK_CACHE_TABLE, $start, $end)->will($this->returnValue($result));
     $task->setTitle($title);
     $this->assertEquals($result, $task->getTitlesWithBackLinks());
 }
Beispiel #2
0
 private function queueRefreshTasks($batches)
 {
     global $wgCityId;
     foreach ($batches as $batch) {
         list($start, $end) = $batch;
         $task = new BatchRefreshLinksForTemplate();
         $task->title($this->mTitle);
         $task->wikiId($wgCityId);
         $task->call('refreshTemplateLinks', $start, $end);
         $task->queue();
         Wikia\Logger\WikiaLogger::instance()->info('LinksUpdate::queueRefreshTasks', ['title' => $this->mTitle->getPrefixedDBkey(), 'start' => $start, 'end' => $end]);
     }
 }