Add @coversNothing in places where @covers does not apply
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 28 Dec 2017 08:38:21 +0000 (00:38 -0800)
committerLegoktm <legoktm@member.fsf.org>
Thu, 28 Dec 2017 08:53:40 +0000 (08:53 +0000)
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
tests/phpunit/includes/db/DatabaseSqliteTest.php
tests/phpunit/includes/http/HttpTest.php
tests/phpunit/includes/registration/ExtensionProcessorTest.php
tests/phpunit/includes/user/UserTest.php

index abef1c9..f1ff947 100644 (file)
@@ -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(
        public function testApiTestGroup() {
                $groups = PHPUnit_Util_Test::getGroups( static::class );
                $constraint = PHPUnit_Framework_Assert::logicalOr(
index deaa65a..dde3a58 100644 (file)
@@ -285,6 +285,9 @@ class DatabaseSqliteTest extends MediaWikiTestCase {
                );
        }
 
                );
        }
 
+       /**
+        * @coversNothing
+        */
        public function testEntireSchema() {
                global $IP;
 
        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
        /**
         * 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;
         */
        public function testUpgrades() {
                global $IP, $wgVersion, $wgProfiler;
index 2d73bac..8ca9f6a 100644 (file)
@@ -495,6 +495,7 @@ class HttpTest extends MediaWikiTestCase {
         * where it did not define a cURL constant. T72570
         *
         * @dataProvider provideCurlConstants
         * where it did not define a cURL constant. T72570
         *
         * @dataProvider provideCurlConstants
+        * @coversNothing
         */
        public function testCurlConstants( $value ) {
                $this->checkPHPExtension( 'curl' );
         */
        public function testCurlConstants( $value ) {
                $this->checkPHPExtension( 'curl' );
index 5ef30e8..acf4710 100644 (file)
@@ -607,6 +607,11 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
                $this->assertSame( [ 'ext.baz.fizzbuzz' ], $info['attributes']['FizzBuzzMorePlugins'] );
        }
 
                $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(
        public function testGlobalSettingsDocumentedInSchema() {
                global $IP;
                $globalSettings = TestingAccessWrapper::newFromClass(
index f004e79..ea7f715 100644 (file)
@@ -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
         * 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
         */
        public function testAllRightsWithMessage() {
                // Getting all user rights, for core: User::$mCoreRights, for extensions: $wgAvailableRights