From 355a6cd4c30452027653162ce7782f79df4ada8b Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 9 May 2020 02:15:03 +0100 Subject: [PATCH] phpunit: Add error_reporting/AtEase check to MediaWikiUnitTestCase This existed on MediaWikiIntegrationTestCase, but not on MediaWikiUnitTestCase. As a result of that, I spent about four days tracking down a dangling AtEase::suppressWarnings with missing AtEase::restoreWarnings (as part of Ib6758d724c). Move it to the common MediaWikiTestCaseTrait instead so that we get it on unit/ as well. Example: > There was 1 failure: > > 1) Pbkdf2PasswordTest::testCryptThrows > PHP error_reporting setting found dirty. > Did you forget AtEase::restoreWarnings? Change-Id: I7dc3fe90385c8066b89a5e06c55f5455edfbb4ca --- .phpcs.xml | 22 +++++++++++++++++ .../phpunit/MediaWikiIntegrationTestCase.php | 22 ----------------- tests/phpunit/MediaWikiTestCaseTrait.php | 24 +++++++++++++++++++ .../includes/password/Pbkdf2PasswordTest.php | 6 +---- 4 files changed, 47 insertions(+), 27 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 3da9f75ee39..0e3e1ad4f25 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -185,7 +185,29 @@ */tests/phpunit/maintenance/*\.php */tests/phpunit/integration/includes/GlobalFunctions/*\.php + + + */tests/*\.php +