diff options
author | Gergő Tisza <tgr.huwiki@gmail.com> | 2019-03-01 19:06:54 -0800 |
---|---|---|
committer | Legoktm <legoktm@member.fsf.org> | 2019-06-11 21:40:14 +0000 |
commit | 45d4e8d13a250885be42876cda3c4a836b183c59 (patch) | |
tree | a3ea6d27976769332422dbed534b63bc6492310a | |
parent | 715f040a5f1e7ae7fbc9f0a4729676d4ad597570 (diff) | |
download | mediawikicore-45d4e8d13a250885be42876cda3c4a836b183c59.tar.gz mediawikicore-45d4e8d13a250885be42876cda3c4a836b183c59.zip |
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
-rw-r--r-- | .phpcs.xml | 3 | ||||
-rw-r--r-- | tests/phpunit/structure/ApiPrefixUniquenessTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/ApiStructureTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/AutoLoaderStructureTest.php | 3 | ||||
-rw-r--r-- | tests/phpunit/structure/AvailableRightsTest.php | 5 | ||||
-rw-r--r-- | tests/phpunit/structure/ContentHandlerSanityTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/DatabaseIntegrationTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/ExtensionJsonValidationTest.php | 2 | ||||
-rw-r--r-- | tests/phpunit/structure/PasswordPolicyStructureTest.php | 3 | ||||
-rw-r--r-- | tests/phpunit/structure/ResourcesTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/SpecialPageFatalTest.php | 1 | ||||
-rw-r--r-- | tests/phpunit/structure/StructureTest.php | 1 |
12 files changed, 3 insertions, 20 deletions
diff --git a/.phpcs.xml b/.phpcs.xml index 22b74b514af6..9ccf5657b778 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -256,6 +256,9 @@ --> <exclude-pattern>*/maintenance/mwdocgen\.php</exclude-pattern> </rule> + <rule ref="MediaWiki.Commenting.MissingCovers.MissingCovers"> + <exclude-pattern>tests/phpunit/structure/*</exclude-pattern> + </rule> <file>.</file> <arg name="encoding" value="UTF-8"/> <arg name="extensions" value="php,php5,inc,sample"/> diff --git a/tests/phpunit/structure/ApiPrefixUniquenessTest.php b/tests/phpunit/structure/ApiPrefixUniquenessTest.php index 4f95fbbb3e78..432986703021 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 0d10a20b221c..6b64b409c2d9 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 4e1b00abba7e..37babcef1437 100644 --- a/tests/phpunit/structure/AutoLoaderStructureTest.php +++ b/tests/phpunit/structure/AutoLoaderStructureTest.php @@ -1,8 +1,5 @@ <?php -/** - * @coversNothing - */ class AutoLoaderStructureTest extends MediaWikiTestCase { /** * Assert that there were no classes loaded that are not registered with the AutoLoader. diff --git a/tests/phpunit/structure/AvailableRightsTest.php b/tests/phpunit/structure/AvailableRightsTest.php index 57b063d5baa1..2a6575a9ece2 100644 --- a/tests/phpunit/structure/AvailableRightsTest.php +++ b/tests/phpunit/structure/AvailableRightsTest.php @@ -35,9 +35,6 @@ class AvailableRightsTest extends PHPUnit\Framework\TestCase { return $rights; } - /** - * @coversNothing - */ public function testAvailableRights() { $missingRights = array_diff( $this->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 c75a9d02a3c5..c8bcd60de3d4 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 9c0a73de8dfd..b0c1c8f1f5e3 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 dea8f5a54194..60c97ccfac14 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 60ce575e4c45..d7f865d2e77a 100644 --- a/tests/phpunit/structure/PasswordPolicyStructureTest.php +++ b/tests/phpunit/structure/PasswordPolicyStructureTest.php @@ -1,8 +1,5 @@ <?php -/** - * @coversNothing - */ class PasswordPolicyStructureTest extends MediaWikiTestCase { public function provideChecks() { diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php index f41ab3a11f69..4c34208e0d17 100644 --- a/tests/phpunit/structure/ResourcesTest.php +++ b/tests/phpunit/structure/ResourcesTest.php @@ -14,7 +14,6 @@ use Wikimedia\TestingAccessWrapper; * @copyright © 2012, Niklas Laxström * @copyright © 2012, Santhosh Thottingal * @copyright © 2012, Timo Tijhof - * @coversNothing */ class ResourcesTest extends MediaWikiTestCase { diff --git a/tests/phpunit/structure/SpecialPageFatalTest.php b/tests/phpunit/structure/SpecialPageFatalTest.php index 026b90325036..3fa31fe8b588 100644 --- a/tests/phpunit/structure/SpecialPageFatalTest.php +++ b/tests/phpunit/structure/SpecialPageFatalTest.php @@ -11,7 +11,6 @@ use MediaWiki\MediaWikiServices; * * @since 1.32 * @author Addshore - * @coversNothing */ class SpecialPageFatalTest extends MediaWikiTestCase { public function provideSpecialPages() { diff --git a/tests/phpunit/structure/StructureTest.php b/tests/phpunit/structure/StructureTest.php index 97bed4c7a8cd..412ee991f9eb 100644 --- a/tests/phpunit/structure/StructureTest.php +++ b/tests/phpunit/structure/StructureTest.php @@ -9,7 +9,6 @@ class StructureTest extends MediaWikiTestCase { * Verify all files that appear to be tests have file names ending in * Test. If the file names do not end in Test, they will not be run. * @group medium - * @coversNothing */ public function testUnitTestFileNamesEndWithTest() { // realpath() also normalizes directory separator on windows for prefix compares |