wiki.techinc.nl/tests/phpunit/includes/Status
Tim Starling e98f23c885 message: Don't load user language when a specific language was requested
Message::setContext() called $context->getLanguage(), loading the user
options from the database, which is unnecessary if
Message::inLanguage() is called immediately afterwards.

In a ResourceLoader module, RequestContext::getLanguage() throws an
exception due to MW_NO_SESSION being defined. For example, an exception
was thrown if any HTTP client error was encountered, since log message
formatting includes a call to Message::setContext().

So defer the call to RequestContext::getLanguage() by having
Message::setContext() make a closure which later fetches the language if
necessary.

Add an integration test which previously failed.

Change-Id: I326c7e3a9492952d721fb52f1868ab9c1033e683
2024-03-04 12:03:38 +11:00
..
StatusFormatterTest.php message: Don't load user language when a specific language was requested 2024-03-04 12:03:38 +11:00
StatusTest.php tests: Fix @covers and @coversDefaultClass to have leading \ 2024-02-16 22:43:56 +00:00