From 45d4e8d13a250885be42876cda3c4a836b183c59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Fri, 1 Mar 2019 19:06:54 -0800 Subject: [PATCH 1/1] Exempt structure tests from @covers checks @covers does not make any sense for structure tests, which either do not cover any PHP lines (they test things like configuration or messages), or cover lines which cannot be determined at the time of writing the tests (e.g. they cover all classes implementing a certain interface). Requiring @coversNothing to be manually added for all of them is a waste of developer time. tests/phpunit/suite.xml has forceCoversAnnotation=true so removing the annotations will not change test coverage, these files will still be skipped. Change-Id: I27cb58e92341b9b1a76f109701f5bc843adbaa9b --- .phpcs.xml | 3 +++ tests/phpunit/structure/ApiPrefixUniquenessTest.php | 1 - tests/phpunit/structure/ApiStructureTest.php | 1 - tests/phpunit/structure/AutoLoaderStructureTest.php | 3 --- tests/phpunit/structure/AvailableRightsTest.php | 5 ----- tests/phpunit/structure/ContentHandlerSanityTest.php | 1 - tests/phpunit/structure/DatabaseIntegrationTest.php | 1 - tests/phpunit/structure/ExtensionJsonValidationTest.php | 2 -- tests/phpunit/structure/PasswordPolicyStructureTest.php | 3 --- tests/phpunit/structure/ResourcesTest.php | 1 - tests/phpunit/structure/SpecialPageFatalTest.php | 1 - tests/phpunit/structure/StructureTest.php | 1 - 12 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 22b74b514a..9ccf5657b7 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -256,6 +256,9 @@ --> */maintenance/mwdocgen\.php + + tests/phpunit/structure/* + . diff --git a/tests/phpunit/structure/ApiPrefixUniquenessTest.php b/tests/phpunit/structure/ApiPrefixUniquenessTest.php index 4f95fbbb3e..4329867030 100644 --- a/tests/phpunit/structure/ApiPrefixUniquenessTest.php +++ b/tests/phpunit/structure/ApiPrefixUniquenessTest.php @@ -4,7 +4,6 @@ * Checks that all API query modules, core and extensions, have unique prefixes. * * @group API - * @coversNothing */ class ApiPrefixUniquenessTest extends MediaWikiTestCase { diff --git a/tests/phpunit/structure/ApiStructureTest.php b/tests/phpunit/structure/ApiStructureTest.php index 0d10a20b22..6b64b409c2 100644 --- a/tests/phpunit/structure/ApiStructureTest.php +++ b/tests/phpunit/structure/ApiStructureTest.php @@ -11,7 +11,6 @@ use Wikimedia\TestingAccessWrapper; * - do not have inconsistencies in the parameter definitions * * @group API - * @coversNothing */ class ApiStructureTest extends MediaWikiTestCase { diff --git a/tests/phpunit/structure/AutoLoaderStructureTest.php b/tests/phpunit/structure/AutoLoaderStructureTest.php index 4e1b00abba..37babcef14 100644 --- a/tests/phpunit/structure/AutoLoaderStructureTest.php +++ b/tests/phpunit/structure/AutoLoaderStructureTest.php @@ -1,8 +1,5 @@ getAllVisibleRights(), @@ -69,8 +66,6 @@ class AvailableRightsTest extends PHPUnit\Framework\TestCase { * 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() { $this->checkMessagesExist( 'right-' ); diff --git a/tests/phpunit/structure/ContentHandlerSanityTest.php b/tests/phpunit/structure/ContentHandlerSanityTest.php index c75a9d02a3..c8bcd60de3 100644 --- a/tests/phpunit/structure/ContentHandlerSanityTest.php +++ b/tests/phpunit/structure/ContentHandlerSanityTest.php @@ -32,7 +32,6 @@ class ContentHandlerSanityTest extends MediaWikiTestCase { } /** - * @coversNothing * @dataProvider provideHandlers * @param ContentHandler $handler */ diff --git a/tests/phpunit/structure/DatabaseIntegrationTest.php b/tests/phpunit/structure/DatabaseIntegrationTest.php index 9c0a73de8d..b0c1c8f1f5 100644 --- a/tests/phpunit/structure/DatabaseIntegrationTest.php +++ b/tests/phpunit/structure/DatabaseIntegrationTest.php @@ -5,7 +5,6 @@ use Wikimedia\Rdbms\Database; /** * @group Database - * @coversNothing */ class DatabaseIntegrationTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/structure/ExtensionJsonValidationTest.php b/tests/phpunit/structure/ExtensionJsonValidationTest.php index dea8f5a541..60c97ccfac 100644 --- a/tests/phpunit/structure/ExtensionJsonValidationTest.php +++ b/tests/phpunit/structure/ExtensionJsonValidationTest.php @@ -19,8 +19,6 @@ /** * Validates all loaded extensions and skins using the ExtensionRegistry * against the extension.json schema in the docs/ folder. - * - * @coversNothing */ class ExtensionJsonValidationTest extends PHPUnit\Framework\TestCase { diff --git a/tests/phpunit/structure/PasswordPolicyStructureTest.php b/tests/phpunit/structure/PasswordPolicyStructureTest.php index 60ce575e4c..d7f865d2e7 100644 --- a/tests/phpunit/structure/PasswordPolicyStructureTest.php +++ b/tests/phpunit/structure/PasswordPolicyStructureTest.php @@ -1,8 +1,5 @@