wiki.techinc.nl/tests/phpunit/includes
Petr Pchelko 788331c48a Introduce UserOptionsManager and DefaultOptionsManager
This converts user options management to a separate
service for use in DI context.

User options are accessed quite early on in installation
process and full-on options management depends on the
database. Prior we have protected from accessing the DB
by setting a hacky $wgUser with 0 id, and relying on the
implementation that it doesn't go into the database to
get the default user options. Now we can't really do that
since DBLoadBalancer is required to instantiate the options
manager. Instead, we redefine the options manager with
a DefaultOptionsManager, that only provides access to
default options and doesn't require DB access.

UserOptionsManager uses PreferencesFactory, however
injecting it will produce a cyclic dependency. The problem
is that we separate options to different kinds, which are
inferred from the PreferencesFactory declaration for those
options (e.g. if it's a radio button in the UI declaration,
the option is of multiselect kind). This is plain wrong,
the dependency should be wise versa. This will be addressed
separately, since it's requires larger refactoring. For now
the PreferencesFactory is obtained on demand. This will be
addressed in a followup.

Bug: T248527
Change-Id: I74917c5eaec184d188911a319895b941ed55ee87
2020-04-28 15:42:43 -07:00
..
actions Merge "Hide deprecated warnings for Hooks::clear()" 2020-04-15 02:38:31 +00:00
api Introduce UserOptionsManager and DefaultOptionsManager 2020-04-28 15:42:43 -07:00
auth Hook Container 2020-04-17 15:48:38 +10:00
block DatabaseBlock: Deprecate some obsolete methods 2020-04-15 20:35:48 +01:00
cache cache: Remove use of $wgContLanguageCode in MessageCacheTest 2020-03-15 00:23:02 +00:00
changes CategoryMembershipChangeTest: Remove use of Revision objects 2020-04-24 04:36:51 +00:00
changetags tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
collation tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
config Replace all new stdClass() with identical (object)[] 2020-03-04 21:18:30 +00:00
content Add @author tags I forgot to include 2020-04-11 08:13:48 +00:00
context Coding style: Auto-fix MediaWiki.Usage.PHPUnit* 2020-01-10 10:17:12 +00:00
db rdbms: add "loadMonitor" parameter to LBFactoryMulti/LBFactorySimple 2020-03-27 20:43:00 -07:00
debug deprecation: Remove DeprecationHelper::newArgumentWithDeprecation and change callers accordingly 2020-04-27 20:23:58 +03:00
deferred Merge "RevisionStore and PageUpdater: handle stale page ID" 2020-04-27 21:16:52 +00:00
diff Fix most PHPUnit 8 compat issues in DBless tests 2019-12-15 00:24:21 +00:00
editpage Autofix 94 PHPUnit 8 compat issues 2019-12-13 15:29:10 +01:00
exception Make MWException show up pretty even if $wgLang is a stub 2020-03-23 03:49:45 +00:00
externalstore ExternalStore: report cause of non-exception failure 2020-04-17 18:00:28 +02:00
filebackend Set logger to null when connecting to DB in DBFileJournalIntegrationTest.php 2020-04-13 09:43:40 -07:00
filerepo Use MediaWikiServices::getRepoGroup in file related classes 2020-03-14 12:36:27 +00:00
GlobalFunctions Use MediaWikiServices::getMessageCache 2020-03-14 14:25:03 +01:00
htmlform HTMLForm: Allow status object to have raw parameters 2020-02-09 18:06:12 +01:00
http Support cookies in GuzzleHttpRequest 2020-03-18 21:48:26 +03:00
import Hard deprecate Revision::getQueryInfo and ::getArchiveQueryInfo 2020-03-26 23:53:19 +00:00
interwiki Remove Language::factory and getParentLanguage use 2019-10-27 12:34:28 +02:00
jobqueue Merge "Delete watchlist_expiry rows when clearing watchlist with job" 2020-04-28 21:28:24 +00:00
language Tests: Remove unneeded uses of global $wgUser 2020-03-12 00:52:43 +00:00
libs rdbms: add IDatabase::QUERY_* flags to obviate isWriteQuery() 2020-04-28 00:49:11 +00:00
linkeddata Fix most PHPUnit 8 compat issues in DBless tests 2019-12-15 00:24:21 +00:00
linker tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
logging Stop using assertContains with string haystack 2019-12-15 00:22:44 +00:00
mail
media Add const visibility to includes/media 2020-04-26 23:25:41 +00:00
Message UserNameUtils: use ITextFormatter instead of MessageLocalizer 2020-04-13 09:28:02 -07:00
Navigation Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
objectcache SqlBagOStuff: Add a limit to key length 2020-02-26 13:22:51 -08:00
page Merge "Replace uses and hard deprecate Article::getRevisionFetched" 2020-04-27 18:33:39 +00:00
pager tests: Replace PHPUnit's loose assertEquals(null) with assertNull() 2019-09-27 19:15:38 +00:00
ParamValidator/TypeDef UserDef: Don't return incomplete UserIdentityValues 2020-02-19 15:28:40 -05:00
parser Merge "Refactor magic word implementations out of Parser.php" 2020-04-22 08:34:54 +00:00
password Password policy to check if a password is a substring of a username 2020-01-13 23:09:13 +00:00
Permissions Merge "Revert "Replace weird stdClass mock with class actually expected"" 2020-03-03 23:09:07 +00:00
poolcounter Replace uses and hard deprecate Article:: and WikiPage::getRevision 2020-04-20 23:06:48 +00:00
preferences parser: Inject a LanguageConverterFactory through DI containers: 2020-02-04 14:42:03 +02:00
rcfeed tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
registration Hook Container 2020-04-17 15:48:38 +10:00
resourceloader resourceloader: Remove internal 'sync' option from ClientHtml 2020-04-23 20:48:04 +00:00
Rest WebRequest & RequestFromGlobals: get HTTP headers in one way 2020-04-03 09:32:41 +02:00
Revision Merge "RevisionStore and PageUpdater: handle stale page ID" 2020-04-27 21:16:52 +00:00
search Fix failing tests relying on private Hooks.php properties 2020-04-13 22:58:26 +00:00
session Replace deprecated PHPUnit method in test 2020-04-02 10:06:58 +01:00
shell Make use of PHPUnit's assertCount feature where possible 2020-03-02 15:58:41 +00:00
site Make use of PHPUnit's assertCount feature where possible 2020-03-02 15:58:41 +00:00
skins Add MediaWikiIntegrationTestCase::assertArraySubmapSame() 2020-03-19 15:53:59 -07:00
sparql Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNull 2020-01-10 14:17:13 -08:00
specialpage Introduce UserOptionsManager and DefaultOptionsManager 2020-04-28 15:42:43 -07:00
specials Merge "Introduce SpecialUnblockTest with some basic tests" 2020-04-28 19:36:57 +00:00
Storage Merge "RevisionStore and PageUpdater: handle stale page ID" 2020-04-27 21:16:52 +00:00
title Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNull 2020-01-10 14:17:13 -08:00
upload Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal 2020-03-25 11:34:17 -07:00
user Introduce UserOptionsManager and DefaultOptionsManager 2020-04-28 15:42:43 -07:00
utils Move UIDGenerator code to a service and put it under /libs 2020-02-18 00:20:40 +00:00
watcheditem Merge "Add expiry type to ParamValidator" 2020-04-09 16:57:41 +00:00
ActorMigrationTest.php Replace complicated assertions with assertIsString() and such 2020-01-28 19:17:58 +00:00
ActorMigrationTest.sql Mostly drop old pre-actor user schemas 2019-09-09 11:38:36 -04:00
AutoLoaderTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
AutopromoteTest.php Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
CategoryTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
CommentStoreCommentTest.php Revert "Separate MediaWiki unit and integration tests" 2019-06-13 23:00:08 +00:00
CommentStoreTest.php Remove CommentStore::newKey, deprecated and unused 2020-02-20 02:00:15 +00:00
CommentStoreTest.sql
ContentSecurityPolicyTest.php include blob: as a default script-src 2020-02-27 19:02:55 +00:00
DeprecatedGlobalTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
DiffHistoryBlobTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
EditPageTest.php Merge "phpunit: Change optional params before required params to also be required" 2020-03-30 21:29:45 +00:00
ExportTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
ExtraParserTest.php Hard-deprecate direct calls to Parser::__construct() 2020-04-16 16:34:34 -04:00
FauxRequestTest.php Replace complicated assertions with assertIsString() and such 2020-01-28 19:17:58 +00:00
GitInfoTest.php Coding style: Auto-fix MediaWiki.Usage.PHPUnit* 2020-01-10 10:17:12 +00:00
HooksTest.php Hook Container 2020-04-17 15:48:38 +10:00
HtmlTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
LinkerTest.php Replace uses and hard deprecate Article:: and WikiPage::getRevision 2020-04-20 23:06:48 +00:00
LinkFilterTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
ListToggleTest.php Remove Language::factory and getParentLanguage use 2019-10-27 12:34:28 +02:00
MagicWordFactoryTest.php Autofix 94 PHPUnit 8 compat issues 2019-12-13 15:29:10 +01:00
MediaWikiServicesTest.php tests: Remove BC code for PHP < 7.1 2020-03-09 18:12:43 +01:00
MediaWikiTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
MediaWikiVersionFetcherTest.php Provide MW_VERSION and deprecate fake global $wgVersion 2020-02-25 01:55:21 +00:00
MergeHistoryTest.php Don't use new MCR schema without using DB 2019-08-13 17:05:24 +03:00
MessageTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
MovePageTest.php MovePage: Don't fail to delete a nonexistent file 2020-04-07 13:58:39 +00:00
MultiHttpClientTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
MWTimestampTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
OutputPageTest.php OutputPage: Add experimental preconnect resource hint for thumbnails 2020-04-07 21:04:47 +00:00
PagePropsTest.php Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal 2020-03-25 11:34:17 -07:00
PrefixSearchTest.php Fix failing tests relying on private Hooks.php properties 2020-04-13 22:58:26 +00:00
ReadOnlyModeTest.php Don't pass Config to service constructors 2019-05-02 11:33:56 +03:00
RevisionDbTest.php Hard deprecate Revision::getNext 2020-04-27 04:12:24 +00:00
RevisionTest.php Hard deprecate Revision::setId 2020-04-11 10:22:36 +00:00
RevisionTestModifyableContent.php
RevisionTestModifyableContentHandler.php
SampleTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
SiteStatsTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
StatusTest.php phpunit: Change optional params before required params to also be required 2020-03-29 15:45:17 +00:00
SystemBlockTest.php Separate Block into AbstractBlock, Block and SystemBlock 2019-05-07 17:36:31 -05:00
TemplateCategoriesTest.php Pass a user to WikiPage::doDeleteArticleReal, use new signature 2020-03-19 00:54:29 +00:00
TestLocalisationCache.php Make LocalisationCache a service 2019-10-07 13:18:47 -07:00
TestLogger.php Use [...] instead of array(...) in PHP comments and documentation 2019-06-17 21:15:09 +02:00
TestUser.php Drop last bits of oracle 2019-08-14 23:44:22 +02:00
TestUserRegistry.php Add missing @param and @return to documentation 2019-11-16 13:45:55 +01:00
TimeAdjustTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
TitleMethodsTest.php Remove Title move functions, deprecated in favor of MovePage class 2020-02-19 20:44:55 -08:00
TitlePermissionTest.php Hard deprecate Title::getUserPermissionsErrors 2020-02-26 05:09:55 +00:00
TitleTest.php title: Remove broken handling of language variant in getCdnUrls() 2020-04-20 18:55:17 +00:00
WebRequestTest.php WebRequest & RequestFromGlobals: get HTTP headers in one way 2020-04-03 09:32:41 +02:00
WikiMapTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
WikiReferenceTest.php phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase 2019-09-02 20:58:34 +01:00
XmlTest.php Coding style: Auto-fix MediaWiki.Usage.PHPUnit* 2020-01-10 10:17:12 +00:00