From 92ee198c66c8798b7a728a7d67bef8520ebd01de Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 28 Dec 2017 00:38:21 -0800 Subject: [PATCH] Add @coversNothing in places where @covers does not apply These tests apply to things that are not relevant to PHP code coverage, such as testing presence of messages, JSON files, or the PHPUnit tests themselves. Using @coversNothing indicates that there is no code here to be covered, and prevents warnings when using --strict-coverage mode (T152923). Change-Id: Id89ee2c15a3ce3f10e34b13fb677cd1af75af9e6 --- tests/phpunit/includes/api/ApiTestCase.php | 3 +++ tests/phpunit/includes/db/DatabaseSqliteTest.php | 4 ++++ tests/phpunit/includes/http/HttpTest.php | 1 + .../phpunit/includes/registration/ExtensionProcessorTest.php | 5 +++++ tests/phpunit/includes/user/UserTest.php | 2 ++ 5 files changed, 15 insertions(+) diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index abef1c9206..f1ff94751e 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -218,6 +218,9 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { ); } + /** + * @coversNothing + */ public function testApiTestGroup() { $groups = PHPUnit_Util_Test::getGroups( static::class ); $constraint = PHPUnit_Framework_Assert::logicalOr( diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index deaa65ad87..dde3a58ed8 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -285,6 +285,9 @@ class DatabaseSqliteTest extends MediaWikiTestCase { ); } + /** + * @coversNothing + */ public function testEntireSchema() { global $IP; @@ -298,6 +301,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { /** * Runs upgrades of older databases and compares results with current schema * @todo Currently only checks list of tables + * @coversNothing */ public function testUpgrades() { global $IP, $wgVersion, $wgProfiler; diff --git a/tests/phpunit/includes/http/HttpTest.php b/tests/phpunit/includes/http/HttpTest.php index 2d73bac548..8ca9f6a268 100644 --- a/tests/phpunit/includes/http/HttpTest.php +++ b/tests/phpunit/includes/http/HttpTest.php @@ -495,6 +495,7 @@ class HttpTest extends MediaWikiTestCase { * where it did not define a cURL constant. T72570 * * @dataProvider provideCurlConstants + * @coversNothing */ public function testCurlConstants( $value ) { $this->checkPHPExtension( 'curl' ); diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index 5ef30e872a..acf4710ffd 100644 --- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -607,6 +607,11 @@ class ExtensionProcessorTest extends MediaWikiTestCase { $this->assertSame( [ 'ext.baz.fizzbuzz' ], $info['attributes']['FizzBuzzMorePlugins'] ); } + /** + * Verify that extension.schema.json is in sync with ExtensionProcessor + * + * @coversNothing + */ public function testGlobalSettingsDocumentedInSchema() { global $IP; $globalSettings = TestingAccessWrapper::newFromClass( diff --git a/tests/phpunit/includes/user/UserTest.php b/tests/phpunit/includes/user/UserTest.php index f004e7913b..ea7f715b5f 100644 --- a/tests/phpunit/includes/user/UserTest.php +++ b/tests/phpunit/includes/user/UserTest.php @@ -236,6 +236,8 @@ class UserTest extends MediaWikiTestCase { * Test, if for all rights a right- message exist, * which is used on Special:ListGroupRights as help text * Extensions and core + * + * @coversNothing */ public function testAllRightsWithMessage() { // Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights -- 2.20.1