Example #1
0
    /**
     * Wrap status errors in an errorbox for increased visiblity
     *
     * @param Status $status
     * @return string
     */
    private function formatStatusErrors(Status $status)
    {
        $errmsg = $status->getHTML('edit-error-short', 'edit-error-long', $this->context->getLanguage());
        return <<<ERROR
<div class="errorbox">
{$errmsg}
</div>
<br clear="all" />
ERROR;
    }
 /**
  * @dataProvider provideGetWikiTextAndHtml
  * @covers Status::getHtml
  * @todo test long and short context messages generated through this method
  *   this can not really be done now due to use of $this->getWikiText using
  *   wfMessage()->plain(). It is possible to mock such methods but only if
  *   namespaces are used.
  */
 public function testGetHtml(Status $status, $wikitext, $html)
 {
     $this->assertEquals($html, $status->getHTML());
 }
Example #3
0
 /**
  * @dataProvider provideGetWikiTextAndHtml
  * @covers Status::getHtml
  */
 public function testGetHtml(Status $status, $wikitext, $wrappedWikitext, $html, $wrappedHtml)
 {
     $this->assertEquals($html, $status->getHTML());
     $this->assertEquals($wrappedHtml, $status->getHTML('wrap-short', 'wrap-long', 'qqx'));
 }