mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-12 01:01:29 +00:00
Fix coverage report for ErrorReporter
The structure of this class changed a lot in If2fe5f5 (T239572). This was never reflected in the @covers tags. I suggest to go with a trivial @covers for the entire class and let PHPUnit figure it out. The alternative is to kind of repeat many private implementation details, and this doesn't feel right. Change-Id: Ie414876489133ab9aca934c19a5e403cd339abf1
This commit is contained in:
parent
f0c77eb4c5
commit
d44754168f
|
@ -10,16 +10,13 @@ use Parser;
|
||||||
use ParserOptions;
|
use ParserOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @coversDefaultClass \Cite\ErrorReporter
|
* @covers \Cite\ErrorReporter
|
||||||
*
|
*
|
||||||
* @license GPL-2.0-or-later
|
* @license GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
class ErrorReporterTest extends \MediaWikiUnitTestCase {
|
class ErrorReporterTest extends \MediaWikiUnitTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::__construct
|
|
||||||
* @covers ::getInterfaceLanguageAndSplitCache
|
|
||||||
* @covers ::plain
|
|
||||||
* @dataProvider provideErrors
|
* @dataProvider provideErrors
|
||||||
*/
|
*/
|
||||||
public function testPlain(
|
public function testPlain(
|
||||||
|
@ -35,9 +32,6 @@ class ErrorReporterTest extends \MediaWikiUnitTestCase {
|
||||||
$reporter->plain( $mockParser, $key, 'first param' ) );
|
$reporter->plain( $mockParser, $key, 'first param' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers ::halfParsed
|
|
||||||
*/
|
|
||||||
public function testHalfParsed() {
|
public function testHalfParsed() {
|
||||||
$language = $this->createLanguage();
|
$language = $this->createLanguage();
|
||||||
$reporter = $this->createReporter( $language );
|
$reporter = $this->createReporter( $language );
|
||||||
|
@ -89,7 +83,7 @@ class ErrorReporterTest extends \MediaWikiUnitTestCase {
|
||||||
return new ErrorReporter( $mockMessageLocalizer );
|
return new ErrorReporter( $mockMessageLocalizer );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createParser( Language $language, array $expectedCategories ) {
|
private function createParser( Language $language, array $expectedCategories ) : Parser {
|
||||||
$parserOptions = $this->createMock( ParserOptions::class );
|
$parserOptions = $this->createMock( ParserOptions::class );
|
||||||
$parserOptions->method( 'getUserLangObj' )->willReturn( $language );
|
$parserOptions->method( 'getUserLangObj' )->willReturn( $language );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue