language = MediaWikiServices::getInstance()->getLanguageFactory()
->getLanguage( 'qqx' );
}
public function testHtmlError() {
$parser = $this->createMock( Parser::class );
$parser->expects( $this->once() )
->method( 'addTrackingCategory' );
$parser->expects( $this->once() )
->method( 'recursiveTagParse' )
->willReturnArgument( 0 );
$reporter = new CiteErrorReporter( $this->language, $parser );
$html = $reporter->halfParsed( 'cite_error_example', 'first param' );
$this->assertSame(
'(cite_error: (cite_error_example: first param))',
$html
);
}
public function testWikitextWarning() {
$parser = $this->createMock( Parser::class );
$parser->expects( $this->never() )
->method( 'addTrackingCategory' );
$parser->expects( $this->never() )
->method( 'recursiveTagParse' );
$reporter = new CiteErrorReporter( $this->language, $parser );
$wikitext = $reporter->plain( 'cite_warning_example', 'first param' );
$this->assertSame(
'(cite_warning: (cite_warning_example: first param))',
$wikitext
);
}
}