From: C. Scott Ananian Date: Fri, 21 Sep 2018 15:20:36 +0000 (-0400) Subject: Ensure disabled deprecation warnings are re-enabled before next test X-Git-Tag: 1.34.0-rc.0~3992^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=8025629395cc13bc8f6682c007ca51a5d962d7d2;p=lhc%2Fweb%2Fwiklou.git Ensure disabled deprecation warnings are re-enabled before next test Tests should not interfere with each other; disabled deprecation warnings should be disabled for a single test case only. Bug: T191960 Change-Id: Ic9b892bc83ba6d71c1077df0d93c95dde36988bb --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index af014b9812..d675e8518b 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -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; diff --git a/tests/phpunit/includes/debug/DeprecationHelperTest.php b/tests/phpunit/includes/debug/DeprecationHelperTest.php index 55e5bbf28b..6b977a3eaf 100644 --- a/tests/phpunit/includes/debug/DeprecationHelperTest.php +++ b/tests/phpunit/includes/debug/DeprecationHelperTest.php @@ -20,11 +20,6 @@ class DeprecationHelperTest extends MediaWikiTestCase { $this->setMwGlobals( 'wgDevelopmentWarnings', false ); } - public function tearDown() { - parent::tearDown(); - MWDebug::clearLog(); - } - /** * @dataProvider provideGet */