wiki.techinc.nl/tests/phpunit/includes
Tim Starling 68c433bd23 Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.

General principles:
* Use DI if it is already used. We're not changing the way state is
  managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
  is a service, it's a more generic interface, it is the only
  thing that provides isRegistered() which is needed in some cases,
  and a HookRunner can be efficiently constructed from it
  (confirmed by benchmark). Because HookContainer is needed
  for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
  SpecialPage and ApiBase have getHookContainer() and getHookRunner()
  methods in the base class, and classes that extend that base class
  are not expected to know or care where the base class gets its
  HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
  getHookRunner() methods, getting them from the global service
  container. The point of this is to ease migration to DI by ensuring
  that call sites ask their local friendly base class rather than
  getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
  methods did not seem warranted, there is a private HookRunner property
  which is accessed directly. Very rarely (two cases), there is a
  protected property, for consistency with code that conventionally
  assumes protected=private, but in cases where the class might actually
  be overridden, a protected accessor is preferred over a protected
  property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
  global code. In a few cases it was used for objects with broken
  construction schemes, out of horror or laziness.

Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore

Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router

setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine

Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-05-30 14:23:28 +00:00
..
actions Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
api Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
auth Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
block Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
cache Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
changes Add tests for Hook run call sites 2020-05-14 15:09:36 +00:00
changetags
collation
config
content Add @author tags I forgot to include 2020-04-11 08:13:48 +00:00
context
db Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
debug Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
deferred Add missing visibility on methods of deferred related classes 2020-05-10 22:15:41 +00:00
diff
editpage
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 tests: Make static/non-static functions match 2020-04-29 10:59:53 +03:00
filerepo filerepo: make LocalRepo::getSharedCacheKey() use makeGlobalKey() 2020-05-23 17:32:55 +00:00
GlobalFunctions GlobalFunctions: Fix wfPercent() with negative accuracy 2020-05-04 18:48:08 +03:00
HookContainer HookContainer Integration Test 2020-05-11 13:45:39 -07:00
htmlform
http Respect configured default HTTP timeouts, and introduce max timeouts 2020-05-21 09:30:57 +10:00
import Hard deprecate Revision::getQueryInfo and ::getArchiveQueryInfo 2020-03-26 23:53:19 +00:00
interwiki Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
jobqueue Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
language
libs mime: Update usage of MimeAnalyzer methods 2020-05-28 20:13:47 +00:00
linkeddata
linker Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
logging
mail
media Call BitmapMetadataHandler functions statically 2020-05-18 00:53:43 +01:00
Message UserNameUtils: use ITextFormatter instead of MessageLocalizer 2020-04-13 09:28:02 -07:00
Navigation
objectcache objectcache: dependency inject LoadBalancer into SqlBagOStuff 2020-05-18 21:04:17 -07:00
page Hard deprecate Revision::getUserText, ::isMinor, and ::isCurrent 2020-05-26 22:19:54 +00:00
pager
ParamValidator/TypeDef
parser Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
password
Permissions Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
poolcounter Replace uses and hard deprecate Article:: and WikiPage::getRevision 2020-04-20 23:06:48 +00:00
preferences Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
rcfeed
registration tests: Add test file to test SPDX license expressions 2020-05-02 12:47:31 +01:00
resourceloader Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
Rest Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
Revision Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
search Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
session Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
shell
site
skins skins: Move some BaseTemplate functions to Skin 2020-05-09 02:23:48 +00:00
sparql
specialpage Fix SingleSpaceBeforeSingleLineComment 2020-05-11 00:57:11 +00:00
specials Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
Storage Merge "RevisionStore and PageUpdater: handle stale page ID" 2020-04-27 21:16:52 +00:00
title Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
upload upload: Fix incorrect handling of missing file extension in UploadStash 2020-05-22 18:26:18 -04:00
user Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
utils
watcheditem Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
ActorMigrationTest.php
ActorMigrationTest.sql
AutoLoaderTest.php
AutopromoteTest.php
CategoryTest.php
CommentStoreCommentTest.php
CommentStoreTest.php
CommentStoreTest.sql
ContentSecurityPolicyTest.php Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
DeprecatedGlobalTest.php
DiffHistoryBlobTest.php
EditPageTest.php Merge "phpunit: Change optional params before required params to also be required" 2020-03-30 21:29:45 +00:00
ExportTest.php Work around change in SimpleXMLElement behavior introduced in PHP 7.3.17 2020-04-30 18:27:15 -04:00
ExtraParserTest.php Hard-deprecate direct calls to Parser::__construct() 2020-04-16 16:34:34 -04:00
FauxRequestTest.php
GitInfoTest.php
HooksTest.php Hook Container 2020-04-17 15:48:38 +10:00
HtmlTest.php
LinkerTest.php resources: Bundle ajax patrol and ajax rollback code 2020-05-28 07:22:07 +00:00
LinkFilterTest.php
ListToggleTest.php
MagicWordFactoryTest.php Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
MediaWikiServicesTest.php
MediaWikiTest.php
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php Inject SpamChecker where needed, hard deprecate EditPage static methods 2020-05-26 03:17:29 -07:00
MessageTest.php
MovePageTest.php Merge "immobile-source-namespace: use blanknamespace for main namespace" 2020-05-28 21:32:09 +00:00
MultiHttpClientTest.php Respect configured default HTTP timeouts, and introduce max timeouts 2020-05-21 09:30:57 +10:00
MWTimestampTest.php
OutputPageTest.php Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
PagePropsTest.php Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal 2020-03-25 11:34:17 -07:00
PrefixSearchTest.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
ReadOnlyModeTest.php
RevisionDbTest.php Hooks::run() call site migration 2020-05-30 14:23:28 +00:00
RevisionTest.php Hard deprecate Revision::getParentId and ::getVisibility 2020-05-27 23:35:18 +00:00
RevisionTestModifyableContent.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
RevisionTestModifyableContentHandler.php
SampleTest.php
SiteStatsTest.php
StatusTest.php phpunit: Change optional params before required params to also be required 2020-03-29 15:45:17 +00:00
SystemBlockTest.php
TemplateCategoriesTest.php Pass a user to WikiPage::doDeleteArticleReal, use new signature 2020-03-19 00:54:29 +00:00
TestLocalisationCache.php
TestLogger.php
TestUser.php
TestUserRegistry.php
TimeAdjustTest.php
TitleMethodsTest.php
TitlePermissionTest.php
TitleTest.php Fix a plethora of class and function call case mismatches 2020-05-26 14:14:46 +01:00
WebRequestTest.php Fix misplaced expected test value in WebRequestTest 2020-05-29 08:22:51 +02:00
WikiMapTest.php
WikiReferenceTest.php
XmlTest.php