The automatic test in MediaWikiTestCase was marked as risky
authorSeb35 <seb35@seb35.fr>
Sun, 11 Dec 2016 20:16:11 +0000 (21:16 +0100)
committerSeb35 <seb35@seb35.fr>
Sun, 11 Dec 2016 20:16:11 +0000 (21:16 +0100)
MediaWikiTestCase::testMediaWikiTestCaseParentSetupCalled is
marked as risky when strict code coverage is activated in
PHPUnit (--coverage-html ../../docs/code-coverage
--strict-coverage --debug -v).

This patch adds the annotation @coversNothing to disable
code coverage on this test. As an automatically-added test,
it must adapt to a number of different environments, so it
is not feasible to add the exhaustive list of @uses classes.

Bug: T152923
Change-Id: Ic670ff2d89f1c5df500c0d10b153d4efd013d7f4

tests/phpunit/MediaWikiTestCase.php

index db1df5c..9745f5b 100644 (file)
@@ -582,6 +582,10 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        /**
         * Make sure MediaWikiTestCase extending classes have called their
         * parent setUp method
+        *
+        * With strict coverage activated in PHP_CodeCoverage, this test would be
+        * marked as risky without the following annotation (T152923).
+        * @coversNothing
         */
        final public function testMediaWikiTestCaseParentSetupCalled() {
                $this->assertArrayHasKey( 'setUp', $this->called,