aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/MediaWikiUnitTestCase.php
diff options
context:
space:
mode:
authorAryeh Gregor <ayg@aryeh.name>2019-08-13 11:52:13 +0300
committerAryeh Gregor <ayg@aryeh.name>2019-10-25 10:46:20 +0300
commit0d3d6be18d2baa9bd72c1ad496dfc652f6f22d50 (patch)
tree309693cf5f300a9a5d7eeebb9e4923f3bd82219c /tests/phpunit/MediaWikiUnitTestCase.php
parent934d795174d691b007854da31eb5df01598861ac (diff)
downloadmediawikicore-0d3d6be18d2baa9bd72c1ad496dfc652f6f22d50.tar.gz
mediawikicore-0d3d6be18d2baa9bd72c1ad496dfc652f6f22d50.zip
Convert FileBackendGroup to service
Bug: T234228 Change-Id: I25575f565eba122cdf971a5945572811d17fa3e1
Diffstat (limited to 'tests/phpunit/MediaWikiUnitTestCase.php')
-rw-r--r--tests/phpunit/MediaWikiUnitTestCase.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php
index 251dd3374ee3..61768d2abd92 100644
--- a/tests/phpunit/MediaWikiUnitTestCase.php
+++ b/tests/phpunit/MediaWikiUnitTestCase.php
@@ -19,8 +19,10 @@
* @ingroup Testing
*/
+use MediaWiki\Logger\LoggerFactory;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Exception;
+use Wikimedia\ObjectFactory;
/**
* Base class for unit tests.
@@ -107,6 +109,11 @@ abstract class MediaWikiUnitTestCase extends TestCase {
$exception
);
}
+
+ // Don't let LoggerFactory::getProvider() access globals or other things we don't want.
+ LoggerFactory::registerProvider( ObjectFactory::getObjectFromSpec( [
+ 'class' => \MediaWiki\Logger\NullSpi::class
+ ] ) );
}
protected function tearDown() {