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()); }