wiki.techinc.nl/includes/debug
Timo Tijhof e0ed6df864 phpunit: Add setNullLogger() and make tests default to LegacySpi
== Motivation

Mute a log channel, for which the Logger object is injected by
service wiring, for a service that is overridden by default,
such as 'DBLoadBalancerFactory'. For that, calling setLogger()
mid-test would be too late.

== Changes

* Add a test-only method to LegacyLogger that makes it possible
  to change its `minimumLevel` attribute, thus making it turn
  itself into a NullLogger if raised to infinity. This is the
  same principle we use already for disabled log channels when
  using MediaWiki normally (see LegacyLogger::__construct).

* Previously, the developer's LocalSettings.php was loaded
  which includes the Spi configuration. This meant other Spi's
  could be configured which means we might not be dealing with
  a LegacyLogger object.

  Similar to what we do with ObjectCache and JobQueue already,
  make the default Spi in tests the same as the normal MW default.

* Add setNullLogger() which makes use of these two.

Bug: T248195
Change-Id: Ieade3585812de47342259afa765e230fff06f526
2020-04-07 22:00:13 +00:00
..
logger phpunit: Add setNullLogger() and make tests default to LegacySpi 2020-04-07 22:00:13 +00:00
DeprecationHelper.php parser: Inject a LanguageConverterFactory through DI containers: 2020-02-04 14:42:03 +02:00
MWDebug.php Update all use of $wgVersion to MW_VERSION 2020-02-25 02:16:12 +00:00