wiki.techinc.nl/tests/phpunit/includes
Derick Alangi 3bcd9afa01
logging: Fix LogFormatterTestCase from throwing with CheckUser
`CheckUserPrivateEventLogFormatterTest::testLogDatabaseRows()` calls
`LogFormatterTestCase::doTestLogFormatter()` which overrides UserFactory
with a mock which will eventually call `BlockManager::getBlock()` which
tries to create a legacy user object with `newFromUserIdentity()`, but
the overriden UserFactory mock doesn't mock the method `newFromUserIdentity()`,
so will return a NULL user object.

With the NULL user object returned above and CentralAuth enabled, the
`onGetUserBlock()` hook in CA will fire and try to act on a NULL user object
causing the `CentralAuthUser::getInstanceByName()` method in I2c7b4ceb56463e88
to throw as if we're dealing with a user object having an invalid username.

In order to fix this, this patch also mocks the `newFromUserIdentity()` method
in the mocked UserFactory service that gets overridden in test. As a result,
with this patch, the failing tests in CheckUser extension should begin
passing again.

Bug: T343963
Change-Id: I11937d0d53b3914d7f6bd1483404a04b74ac26c9
2024-02-15 16:59:55 +03:00
..
actions Merge "flushOutputBuffer: improve error handling" 2024-02-11 23:43:22 +00:00
api Merge "Add tests for temp user flag" 2024-02-14 14:17:07 +00:00
auth Namespace includes/context 2024-02-08 11:07:01 -05:00
block Namespace includes/context 2024-02-08 11:07:01 -05:00
cache Change more uses of getDBLoadBalancerFactory() to getConnectionProvider() 2024-01-23 16:34:45 +01:00
Category tests: Use namespaced class names in @covers annotations 2024-01-27 01:11:07 +01:00
changes Namespace includes/context 2024-02-08 11:07:01 -05:00
changetags Use native str_contains/str_starts_with in a few more places 2024-01-25 12:17:27 +01:00
collation
CommentStore CommentStore: Remove unused getFields method 2024-01-20 16:21:39 +01:00
composer
config tests: Use namespaced class names in @covers annotations 2024-01-27 01:11:07 +01:00
content Merge "test: Add PHPUnit tests for PreSaveTransformParamsValue" 2024-02-10 14:38:25 +00:00
db rdbms: Drop ILoadBalancer::getAnyOpenConnection() 2023-11-28 15:42:39 +01:00
debug Debugger: Display debug log when $wgShowDebug = true 2024-02-14 20:24:54 +01:00
deferred tests: Use namespaced class names in @covers annotations 2024-01-27 01:11:07 +01:00
diff Namespace includes/context 2024-02-08 11:07:01 -05:00
editpage IntroMessageBuilder: inject connection provider 2024-02-14 17:22:02 +00:00
exception Namespace includes/context 2024-02-08 11:07:01 -05:00
export
ExternalLinks Replace a few manually crafted assertTrue assertions 2023-11-23 09:38:48 +01:00
externalstore
filebackend tests: Change $wgCommandLineMode hacks to preventOpportunisticUpdates() 2023-12-12 18:58:57 +00:00
filerepo Replace more instances of unchecked MWException 2024-01-23 16:20:53 +00:00
GlobalFunctions Autofix spacing around commas 2023-10-25 01:08:44 +02:00
HookContainer
Html Merge "Remove uses of $wgUseMediaWikiUIEverywhere" 2024-02-05 13:59:51 +00:00
htmlform Namespace HTMLForm and friends 2024-02-14 08:18:33 -05:00
http
import Namespace includes/context 2024-02-08 11:07:01 -05:00
installer Namespace WebInstaller classes 2024-01-11 23:29:14 +00:00
interwiki Change more uses of getDBLoadBalancerFactory() to getConnectionProvider() 2024-01-23 16:34:45 +01:00
jobqueue Replace more instances of unchecked MWException 2024-01-23 16:20:53 +00:00
language ZhConverter: Fix language variant fallback chain 2024-02-15 04:20:40 +00:00
languages Autofix spacing around commas 2023-10-25 01:08:44 +02:00
libs tests: Skip failing tests on php8.2 (and make pass) 2023-12-10 22:57:48 +00:00
linkeddata Namespace includes/context 2024-02-08 11:07:01 -05:00
linker Namespace includes/context 2024-02-08 11:07:01 -05:00
logging logging: Fix LogFormatterTestCase from throwing with CheckUser 2024-02-15 16:59:55 +03:00
mail Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
media test: Add PHPUnit tests for BmpHandler 2024-02-08 17:05:02 +00:00
Message Add PHPUnit test for MessageFormatterFactory class 2024-02-06 20:13:12 +00:00
Navigation
objectcache objectcache: Drop support for $wgObjectCaches['db-replicated'] 2023-12-08 18:14:37 +01:00
Output Namespace includes/context 2024-02-08 11:07:01 -05:00
OutputTransform Namespace includes/context 2024-02-08 11:07:01 -05:00
page Merge "WikiPage: remove ::suppressTOC hack" 2024-02-10 02:02:09 +00:00
pager Replace last remaining wfGetDB() calls in core, except ResourceLoader 2024-02-14 11:02:01 -05:00
ParamValidator/TypeDef Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
parser [ParserOutput] Make 'enableSectionEditLinks' a ParserOption 2024-02-09 23:42:03 +00:00
password Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessary 2023-11-21 09:02:48 -05:00
Permissions Namespace includes/context 2024-02-08 11:07:01 -05:00
poolcounter Add ParserOutput::{get,set}RenderId() and set render id in ContentRenderer 2024-02-07 21:22:06 -05:00
preferences Namespace includes/context 2024-02-08 11:07:01 -05:00
profiler
rcfeed Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage 2023-09-18 18:23:13 +01:00
registration Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
Request Namespace includes/context 2024-02-08 11:07:01 -05:00
ResourceLoader Merge "SkinModule - Ensure skins can easily override skin feature styles" 2024-02-15 00:21:29 +00:00
Rest Namespace includes/context 2024-02-08 11:07:01 -05:00
Revision Replace last remaining wfGetDB() calls in core, except ResourceLoader 2024-02-14 11:02:01 -05:00
search Change more uses of getDBLoadBalancerFactory() to getConnectionProvider() 2024-01-23 16:34:45 +01:00
session Namespace includes/context 2024-02-08 11:07:01 -05:00
shell
site tests: Use namespaced class names in @covers annotations 2024-01-27 01:11:07 +01:00
SiteStats Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
skins Namespace includes/context 2024-02-08 11:07:01 -05:00
sparql
specialpage Namespace includes/context 2024-02-08 11:07:01 -05:00
specials Namespace includes/context 2024-02-08 11:07:01 -05:00
Status Make use of the [ ... ] operator instead of array_merge 2024-01-31 15:47:44 +01:00
Storage Move ParsoidRenderID to MediaWiki\Edit 2024-02-07 21:22:06 -05:00
title Hard-deprecate Title::getCdnUrls 2024-02-07 19:09:25 +00:00
upload
user Namespace includes/context 2024-02-08 11:07:01 -05:00
utils tests: Use namespaced class names in @covers annotations 2024-01-27 01:11:07 +01:00
watcheditem Migrate remaining Database::insert calls to InsertQueryBuilder 2023-12-22 14:53:17 +01:00
WikiMap
xml Remove uses of $wgUseMediaWikiUIEverywhere 2024-02-04 19:16:30 +00:00
AutoLoaderTest.php
MediaWikiServicesTest.php Move creation of BlockErrorFormatter into FormatterFactory 2024-01-26 13:03:44 -05:00
MockServiceWiring.php
SampleTest.php
TestUser.php Change uses of getDBLoadBalancerFactory() to getConnectionProvider() 2024-01-22 22:27:45 +01:00
TestUserRegistry.php update a few tests to use PHP 7.4 syntax 2024-01-09 10:19:00 +02:00