Ensure disabled deprecation warnings are re-enabled before next test
authorC. Scott Ananian <cscott@cscott.net>
Fri, 21 Sep 2018 15:20:36 +0000 (11:20 -0400)
committerGergő Tisza <gtisza@wikimedia.org>
Tue, 25 Sep 2018 16:30:38 +0000 (16:30 +0000)
Tests should not interfere with each other; disabled deprecation
warnings should be disabled for a single test case only.

Bug: T191960
Change-Id: Ic9b892bc83ba6d71c1077df0d93c95dde36988bb

tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/debug/DeprecationHelperTest.php

index af014b9..d675e85 100644 (file)
@@ -552,6 +552,8 @@ abstract class MediaWikiTestCase extends PHPUnit\Framework\TestCase {
                        }
                }
 
+               // Re-enable any disabled deprecation warnings
+               MWDebug::clearLog();
                // Restore mw globals
                foreach ( $this->mwGlobals as $key => $value ) {
                        $GLOBALS[$key] = $value;
index 55e5bbf..6b977a3 100644 (file)
@@ -20,11 +20,6 @@ class DeprecationHelperTest extends MediaWikiTestCase {
                $this->setMwGlobals( 'wgDevelopmentWarnings', false );
        }
 
-       public function tearDown() {
-               parent::tearDown();
-               MWDebug::clearLog();
-       }
-
        /**
         * @dataProvider provideGet
         */