Ejemplo n.º 1
0
 /**
  * @dataProvider invalidLanguageCodeProvider
  * @expectedException InvalidArgumentException
  */
 public function testGivenInvalidLanguageCode_hasTermForLanguageThrowsException($languageCode)
 {
     $list = new TermList();
     $list->hasTermForLanguage($languageCode);
 }
 /**
  * @param TermList $descriptions the list of descriptions to render
  *
  * @return string HTML
  */
 private function getDescriptionText(TermList $descriptions)
 {
     if ($descriptions->hasTermForLanguage($this->languageCode)) {
         $text = $descriptions->getByLanguage($this->languageCode)->getText();
         return htmlspecialchars($text);
     } else {
         return wfMessage('wikibase-description-empty')->escaped();
     }
 }
Ejemplo n.º 3
0
 /**
  * @since 0.9
  *
  * @param string $languageCode
  *
  * @return boolean
  */
 public function hasDescription($languageCode)
 {
     return $this->descriptions->hasTermForLanguage($languageCode);
 }