From: Kunal Mehta Date: Mon, 25 Dec 2017 07:28:03 +0000 (-0800) Subject: Add @covers tags to miscellaneous tests X-Git-Tag: 1.31.0-rc.0~1085^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=0c77841534d9139b0042696fe015a15d3e349ef5 Add @covers tags to miscellaneous tests Change-Id: I7e65c1734aef01cd6395ee65204a0158d1635b0c --- diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index d961e415e3..9d56150eb0 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -752,6 +752,9 @@ class GlobalTest extends MediaWikiTestCase { ); } + /** + * @covers ::wfMemcKey + */ public function testWfMemcKey() { $cache = ObjectCache::getLocalClusterInstance(); $this->assertEquals( @@ -760,6 +763,9 @@ class GlobalTest extends MediaWikiTestCase { ); } + /** + * @covers ::wfForeignMemcKey + */ public function testWfForeignMemcKey() { $cache = ObjectCache::getLocalClusterInstance(); $keyspace = $this->readAttribute( $cache, 'keyspace' ); @@ -769,6 +775,9 @@ class GlobalTest extends MediaWikiTestCase { ); } + /** + * @covers ::wfGlobalCacheKey + */ public function testWfGlobalCacheKey() { $cache = ObjectCache::getLocalClusterInstance(); $this->assertEquals( diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index e867f5ec7b..7e32770b33 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -386,6 +386,9 @@ class HtmlTest extends MediaWikiTestCase { ); } + /** + * @covers Html::namespaceSelector + */ public function testCanFilterOutNamespaces() { $this->assertEquals( '' . "\n" . @@ -678,6 +684,9 @@ class HtmlTest extends MediaWikiTestCase { return $ret; } + /** + * @covers Html::input + */ public function testWrapperInput() { $this->assertEquals( '', @@ -691,6 +700,9 @@ class HtmlTest extends MediaWikiTestCase { ); } + /** + * @covers Html::check + */ public function testWrapperCheck() { $this->assertEquals( '', @@ -709,6 +721,9 @@ class HtmlTest extends MediaWikiTestCase { ); } + /** + * @covers Html::radio + */ public function testWrapperRadio() { $this->assertEquals( '', @@ -727,6 +742,9 @@ class HtmlTest extends MediaWikiTestCase { ); } + /** + * @covers Html::label + */ public function testWrapperLabel() { $this->assertEquals( '', diff --git a/tests/phpunit/includes/LinkFilterTest.php b/tests/phpunit/includes/LinkFilterTest.php index ed4958f254..51b54d2c93 100644 --- a/tests/phpunit/includes/LinkFilterTest.php +++ b/tests/phpunit/includes/LinkFilterTest.php @@ -3,6 +3,7 @@ use Wikimedia\Rdbms\LikeMatch; /** + * @covers LinkFilter * @group Database */ class LinkFilterTest extends MediaWikiLangTestCase { diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index d5948edc64..c3488343da 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -525,7 +525,7 @@ class OutputPageTest extends MediaWikiTestCase { $this->assertTrue( $outputPage->haveCacheVaryCookies() ); } - /* + /** * @covers OutputPage::addCategoryLinks * @covers OutputPage::getCategories */ diff --git a/tests/phpunit/includes/PagePropsTest.php b/tests/phpunit/includes/PagePropsTest.php index c96d987017..f602cdabcf 100644 --- a/tests/phpunit/includes/PagePropsTest.php +++ b/tests/phpunit/includes/PagePropsTest.php @@ -1,6 +1,8 @@ assertEquals( $expected, $title->getOtherPage()->getPrefixedText() ); } + /** + * @covers Title::clearCaches + */ public function testClearCaches() { $linkCache = LinkCache::singleton(); diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 75e0c3ef01..d12e4b8643 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -552,6 +552,7 @@ class TitleTest extends MediaWikiTestCase { } /** + * @covers Title::newFromTitleValue * @dataProvider provideNewFromTitleValue */ public function testNewFromTitleValue( TitleValue $value ) { @@ -572,6 +573,7 @@ class TitleTest extends MediaWikiTestCase { } /** + * @covers Title::getTitleValue * @dataProvider provideGetTitleValue */ public function testGetTitleValue( $text ) { @@ -603,6 +605,7 @@ class TitleTest extends MediaWikiTestCase { } /** + * @covers Title::getFragment * @dataProvider provideGetFragment * * @param string $full @@ -913,6 +916,7 @@ class TitleTest extends MediaWikiTestCase { } /** + * @covers Title::getFragmentForURL * @dataProvider provideGetFragmentForURL * * @param string $titleStr diff --git a/tests/phpunit/includes/poolcounter/PoolCounterTest.php b/tests/phpunit/includes/poolcounter/PoolCounterTest.php index d57ad04125..6caf3e5450 100644 --- a/tests/phpunit/includes/poolcounter/PoolCounterTest.php +++ b/tests/phpunit/includes/poolcounter/PoolCounterTest.php @@ -9,6 +9,9 @@ abstract class PoolCounterAbstractMock extends PoolCounter { } } +/** + * @covers PoolCounter + */ class PoolCounterTest extends MediaWikiTestCase { public function testConstruct() { $poolCounterConfig = [ diff --git a/tests/phpunit/includes/upload/UploadBaseTest.php b/tests/phpunit/includes/upload/UploadBaseTest.php index dd68cdcab7..bc7493d5a9 100644 --- a/tests/phpunit/includes/upload/UploadBaseTest.php +++ b/tests/phpunit/includes/upload/UploadBaseTest.php @@ -103,6 +103,8 @@ class UploadBaseTest extends MediaWikiTestCase { } /** + * @covers UploadBase::verifyUpload + * * test uploading a 100 bytes file with $wgMaxUploadSize = 100 * * This method should be abstracted so we can test different settings. @@ -126,6 +128,7 @@ class UploadBaseTest extends MediaWikiTestCase { } /** + * @covers UploadBase::checkSvgScriptCallback * @dataProvider provideCheckSvgScriptCallback */ public function testCheckSvgScriptCallback( $svg, $wellFormed, $filterMatch, $message ) { @@ -512,6 +515,7 @@ class UploadBaseTest extends MediaWikiTestCase { } /** + * @covers UploadBase::detectScriptInSvg * @dataProvider provideDetectScriptInSvg */ public function testDetectScriptInSvg( $svg, $expected, $message ) { @@ -552,6 +556,7 @@ class UploadBaseTest extends MediaWikiTestCase { } /** + * @covers UploadBase::checkXMLEncodingMissmatch * @dataProvider provideCheckXMLEncodingMissmatch */ public function testCheckXMLEncodingMissmatch( $fileContents, $evil ) {