/**
  * @dataProvider messagesProvider
  */
 public function testNormalizeMessages($messages, $expected)
 {
     $this->assertEquals($expected, ProcessingErrorMsgHandler::normalizeMessages($messages, null, 'en'));
     $this->assertInternalType('string', ProcessingErrorMsgHandler::getMessagesAsString($messages, null, 'en'));
 }
 private function getResultHtml()
 {
     $resultList = '';
     if ($this->pageRequestOptions->propertyString === '' || !$this->pageRequestOptions->propertyString) {
         return array($this->messageBuilder->getMessage('smw_sbv_docu')->text(), '', 0);
     }
     // #1728
     if (!$this->pageRequestOptions->property->isValid()) {
         return array(ProcessingErrorMsgHandler::getMessagesAsString($this->pageRequestOptions->property->getErrors()), '', 0);
     }
     if ($this->pageRequestOptions->valueString !== '' && !$this->pageRequestOptions->value->isValid()) {
         return array(ProcessingErrorMsgHandler::getMessagesAsString($this->pageRequestOptions->value->getErrors()), '', 0);
     }
     $exactResults = $this->queryResultLookup->doQuery($this->pageRequestOptions);
     $exactCount = count($exactResults);
     if ($this->canQueryNearbyResults($exactCount)) {
         return $this->getNearbyResults($exactResults, $exactCount);
     }
     if ($this->pageRequestOptions->valueString === '') {
         $resultMessageKey = 'smw-sp-searchbyproperty-nonvaluequery';
     } else {
         $resultMessageKey = 'smw-sp-searchbyproperty-valuequery';
     }
     $resultMessage = $this->messageBuilder->getMessage($resultMessageKey, $this->pageRequestOptions->property->getShortHTMLText($this->linker), $this->pageRequestOptions->value->getShortHTMLText($this->linker))->text();
     if ($exactCount > 0) {
         $resultList = $this->makeResultList($exactResults, $this->pageRequestOptions->limit, true);
     }
     return array(str_replace('_', ' ', $resultMessage), $resultList, $exactCount);
 }