Tim Starling has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/340062 )
Change subject: Fix @covers for (non-integration) parser tests ...................................................................... Fix @covers for (non-integration) parser tests You have to allow tests to cover private Parser methods that they execute. Private methods will never have separate tests. Change-Id: Ic842e2be4675f505dc26d1d3e1dd9000401df46c --- M tests/phpunit/includes/parser/ParserMethodsTest.php M tests/phpunit/includes/parser/ParserPreloadTest.php M tests/phpunit/includes/parser/TagHooksTest.php 3 files changed, 50 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/340062/1 diff --git a/tests/phpunit/includes/parser/ParserMethodsTest.php b/tests/phpunit/includes/parser/ParserMethodsTest.php index 5e00384..ae58d1c 100644 --- a/tests/phpunit/includes/parser/ParserMethodsTest.php +++ b/tests/phpunit/includes/parser/ParserMethodsTest.php @@ -2,8 +2,8 @@ /** * @group Database + * @covers Parser */ - class ParserMethodsTest extends MediaWikiLangTestCase { public static function providePreSaveTransform() { @@ -19,7 +19,6 @@ /** * @dataProvider providePreSaveTransform - * @covers Parser::preSaveTransform */ public function testPreSaveTransform( $text, $expected ) { global $wgParser; @@ -63,7 +62,6 @@ /** * @dataProvider provideStripOuterParagraph - * @covers Parser::stripOuterParagraph */ public function testStripOuterParagraph( $text, $expected ) { $this->assertEquals( $expected, Parser::stripOuterParagraph( $text ) ); @@ -73,7 +71,6 @@ * @expectedException MWException * @expectedExceptionMessage Parser state cleared while parsing. * Did you call Parser::parse recursively? - * @covers Parser::lock */ public function testRecursiveParse() { global $wgParser; @@ -90,9 +87,6 @@ return 'bar'; } - /** - * @covers Parser::callParserFunction - */ public function testCallParserFunction() { global $wgParser; @@ -111,7 +105,7 @@ } /** - * @covers Parser::parse + * @covers Parser * @covers ParserOutput::getSections */ public function testGetSections() { @@ -155,8 +149,6 @@ /** * @dataProvider provideNormalizeLinkUrl - * @covers Parser::normalizeLinkUrl - * @covers Parser::normalizeUrlComponent */ public function testNormalizeLinkUrl( $explanation, $url, $expected ) { $this->assertEquals( $expected, Parser::normalizeLinkUrl( $url ), $explanation ); diff --git a/tests/phpunit/includes/parser/ParserPreloadTest.php b/tests/phpunit/includes/parser/ParserPreloadTest.php index 414ab8f..7707395 100644 --- a/tests/phpunit/includes/parser/ParserPreloadTest.php +++ b/tests/phpunit/includes/parser/ParserPreloadTest.php @@ -2,6 +2,30 @@ /** * Basic tests for Parser::getPreloadText * @author Antoine Musso + * + * @covers Parser + * @covers StripState + * + * @covers Preprocessor_DOM + * @covers PPDStack + * @covers PPDStackElement + * @covers PPDPart + * @covers PPFrame_DOM + * @covers PPTemplateFrame_DOM + * @covers PPCustomFrame_DOM + * @covers PPNode_DOM + * + * @covers Preprocessor_Hash + * @covers PPDStack_Hash + * @covers PPDStackElement_Hash + * @covers PPDPart_Hash + * @covers PPFrame_Hash + * @covers PPTemplateFrame_Hash + * @covers PPCustomFrame_Hash + * @covers PPNode_Hash_Tree + * @covers PPNode_Hash_Text + * @covers PPNode_Hash_Array + * @covers PPNode_Hash_Attr */ class ParserPreloadTest extends MediaWikiTestCase { /** @@ -37,16 +61,10 @@ unset( $this->title ); } - /** - * @covers Parser::getPreloadText - */ public function testPreloadSimpleText() { $this->assertPreloaded( 'simple', 'simple' ); } - /** - * @covers Parser::getPreloadText - */ public function testPreloadedPreIsUnstripped() { $this->assertPreloaded( '<pre>monospaced</pre>', @@ -55,9 +73,6 @@ ); } - /** - * @covers Parser::getPreloadText - */ public function testPreloadedNowikiIsUnstripped() { $this->assertPreloaded( '<nowiki>[[Dummy title]]</nowiki>', diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php index 2a4a4ec..12936ee 100644 --- a/tests/phpunit/includes/parser/TagHooksTest.php +++ b/tests/phpunit/includes/parser/TagHooksTest.php @@ -3,6 +3,30 @@ /** * @group Database * @group Parser + * + * @covers Parser + * @covers StripState + * + * @covers Preprocessor_DOM + * @covers PPDStack + * @covers PPDStackElement + * @covers PPDPart + * @covers PPFrame_DOM + * @covers PPTemplateFrame_DOM + * @covers PPCustomFrame_DOM + * @covers PPNode_DOM + * + * @covers Preprocessor_Hash + * @covers PPDStack_Hash + * @covers PPDStackElement_Hash + * @covers PPDPart_Hash + * @covers PPFrame_Hash + * @covers PPTemplateFrame_Hash + * @covers PPCustomFrame_Hash + * @covers PPNode_Hash_Tree + * @covers PPNode_Hash_Text + * @covers PPNode_Hash_Array + * @covers PPNode_Hash_Attr */ class TagHookTest extends MediaWikiTestCase { public static function provideValidNames() { @@ -21,7 +45,6 @@ /** * @dataProvider provideValidNames - * @covers Parser::setHook */ public function testTagHooks( $tag ) { global $wgParserConf, $wgContLang; @@ -41,7 +64,6 @@ /** * @dataProvider provideBadNames * @expectedException MWException - * @covers Parser::setHook */ public function testBadTagHooks( $tag ) { global $wgParserConf, $wgContLang; @@ -58,7 +80,6 @@ /** * @dataProvider provideValidNames - * @covers Parser::setFunctionTagHook */ public function testFunctionTagHooks( $tag ) { global $wgParserConf, $wgContLang; @@ -78,7 +99,6 @@ /** * @dataProvider provideBadNames * @expectedException MWException - * @covers Parser::setFunctionTagHook */ public function testBadFunctionTagHooks( $tag ) { global $wgParserConf, $wgContLang; -- To view, visit https://gerrit.wikimedia.org/r/340062 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic842e2be4675f505dc26d1d3e1dd9000401df46c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tim Starling <tstarl...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits