/**
  * @covers MassMessage::getParserFunctionTargets
  * @dataProvider provideGetParserFunctionTargets
  * @param  string $text  Text of the page to create
  * @param  array $check Stuff to check against
  */
 public function testGetParserFunctionTargets($text, $check)
 {
     $title = Title::newFromText('Input list ');
     self::updatePage($title, $text);
     $data = MassMessage::getParserFunctionTargets($title, RequestContext::getMain());
     if (empty($check)) {
         // Check that the spamlist is empty
         $this->assertTrue(empty($data));
     } else {
         $data = array_values($data);
         $data = $data[0];
         // We're just testing the first value
         foreach ($check as $key => $value) {
             $this->assertEquals($data[$key], $value);
         }
         if (!isset($check['wiki'])) {
             $this->assertEquals($data['wiki'], wfWikiID());
             // Using wfWikiId() within @dataProviders returns a different result
             // than when we use wfWikiId() within a test
         }
     }
 }
 /**
  * Send out the message
  *
  * @param $data Array
  * @return Status
  */
 protected function submit(array $data)
 {
     $spamlist = $this->getSpamlist($data['spamlist']);
     // Prep the HTML comment message
     $data['comment'] = array($this->getUser()->getName(), wfWikiID(), $spamlist->getFullURL('', false, PROTO_CANONICAL));
     // Log it.
     $this->logToWiki($spamlist, $data['subject']);
     // Insert it into the job queue.
     $pages = MassMessage::getParserFunctionTargets($spamlist, $this->getContext());
     if (!is_array($pages)) {
         $this->status->fatal($pages);
         return $this->status;
     }
     $params = array('data' => $data, 'pages' => $pages);
     $job = new MassMessageSubmitJob($spamlist, $params);
     JobQueueGroup::singleton()->push($job);
     $this->count = count($pages);
     return $this->status;
 }