From 8025629395cc13bc8f6682c007ca51a5d962d7d2 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 21 Sep 2018 11:20:36 -0400 Subject: [PATCH] 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 --- tests/phpunit/MediaWikiTestCase.php | 2 ++ tests/phpunit/includes/debug/DeprecationHelperTest.php | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) 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 */ -- 2.20.1