/**
  * @see ValueFormatter::format
  *
  * @param MonolingualTextValue $value
  *
  * @throws InvalidArgumentException
  * @return string Text
  */
 public function format($value)
 {
     if (!$value instanceof MonolingualTextValue) {
         throw new InvalidArgumentException('Data value type mismatch. Expected a MonolingualTextValue.');
     }
     return $value->getText();
 }
 /**
  * @see ValueFormatter::format
  *
  * @param MonolingualTextValue $value
  *
  * @throws InvalidArgumentException
  * @return string HTML
  */
 public function format($value)
 {
     if (!$value instanceof MonolingualTextValue) {
         throw new InvalidArgumentException('Data value type mismatch. Expected a MonolingualTextValue.');
     }
     $text = $value->getText();
     $languageCode = $value->getLanguageCode();
     $languageName = $this->languageNameLookup->getName($languageCode);
     $msg = wfMessage('wikibase-monolingualtext')->params(wfEscapeWikiText($text), wfEscapeWikiText($languageCode), wfEscapeWikiText($languageName));
     return $msg->parse();
 }
 /**
  * @dataProvider instanceProvider
  * @param MonolingualTextValue $text
  * @param array $arguments
  */
 public function testGetLanguageCode(MonolingualTextValue $text, array $arguments)
 {
     $this->assertEquals($arguments[0], $text->getLanguageCode());
 }