wiki.techinc.nl/tests/phpunit/mocks
DannyS712 722ae6c6e1 Make UserDefTest a unit test
Building on my last few changes to use UserIdentityLookup and
TitleParser, plus the recent addition of UserNameUtils to the
DummyServicesTrait, its now fairly simple to make this a unit
test and retrieve services from DummyServicesTrait instead of
MediaWikiServices.

Add a 'hookContainer' option to
DummyServicesTrait::getDummyUserNameUtils(), because
subclasses of TypeDefTestCase don't have a helper method
createHookContainer() (normally this is provided by
MediaWikiTestCaseTrait). Instead, create a manual mock
HookContainer, like we did previously at NamespaceDefTest.

Also add more options to DummyServicesTrait to allow
callers to provide service instances, needed to avoid
creating two MediaWikiTitleCodec objects and to use
a hook container in NamespaceInfo.

This also required replacing uses of createNoOpMock()
in DummyServicesTrait, because that is also not available
in UserDefTest (its another feature of MediaWikiTestCaseTrait).
It may be worth exploring splitting MediaWikiTestCaseTrait into
the parts that are specific to MediaWiki (like HookContainer
or the Message system) and parts that are useful generally
(like createNoOpMock).

Change-Id: I25b8f0256d222d994173eee66f379fb5422994b5
2021-09-13 23:55:51 -04:00
..
content Introduce concept of generateHTMLOnEdit() for ContentHandler 2021-08-24 22:40:46 +02:00
filebackend
filerepo
json
languages
media
permissions Authority: expose user block info 2021-06-30 13:42:21 +02:00
poolcounter
search LinkCache: soft deprecate addGoodLinkObj() 2021-09-10 16:00:02 +02:00
session
DummyServicesTrait.php Make UserDefTest a unit test 2021-09-13 23:55:51 -04:00
GhostFieldTestClass.php
MockChangesListFilter.php
MockChangesListFilterGroup.php
MockHttpTrait.php MockHttpTrait: support multiple MultiHttpClients 2021-08-12 11:30:14 -07:00
MockMessageLocalizer.php
MockServiceDependenciesTrait.php phpunit: Don't redefine methods in traits 2021-03-23 12:59:34 +00:00
MockTitleTrait.php Remove SearchResultPageIdentity interface 2021-05-10 16:05:45 +02:00
NullHttpRequestFactory.php
NullMultiHttpClient.php
TestLocalisationCache.php build: Updating dependencies 2021-07-22 03:36:05 +00:00
TestLogger.php Remove unused default values from class properties 2021-05-12 13:44:28 +02:00