wiki.techinc.nl/tests/phpunit/mocks
DannyS712 41287e87d8 Add MediaWikiTitleCodec and NamespaceInfo to DummyServicesTrait
Move MockTitleTrait::makeMockTitleCodec to DummyServicesTrait, and
replace the two existing uses, which are in core. Add some new
uses instead of mocking each time.

Unfortunately, we cannot use an actual MediaWikiTitleCodec
for the tests in BadFileLookup, because those tests are unit tests
and a MalformedTitleException cannot be created in the context
of a unit test. BadFileLookupTest gets around this by using
a mock that throws a mock exception - add a comment inline
explaining why we cannot use a real MediaWikiTitleCodec.

Paired with adding of NamespaceInfo to make mocking the language
methods related to namespaces easier by matching the real
logic in the Language class to the extend possible. Update a few
tests to use the DummyServicesTrait for their NamespaceInfo services.

Change-Id: Ibd691ccf0e632e1bf0bc1f7e9ddc0c660d5cad32
2021-05-04 19:10:23 +00:00
..
content Fix some PSR12.Properties.ConstantVisibility.NotFound in tests/phpunit/ 2020-05-09 23:55:09 +00:00
filebackend tests: Use standard utilities for temporary file names 2019-05-06 17:21:45 +00:00
filerepo tests: Use standard utilities for temporary file names 2019-05-06 17:21:45 +00:00
json Safe ParserOutput extension data and JsonUnserializable helper. 2020-11-10 11:21:09 -07:00
languages Language: Turn public properties into Getters in LanguageConverter based hierarchy 2021-02-03 15:17:42 +02:00
media Remove terminating line breaks from debug messages 2020-06-03 12:01:16 +10:00
permissions build: Upgrade mediawiki-codesniffer from v35.0.0 to v36.0.0 2021-04-29 13:00:15 -07:00
poolcounter Fast stale ParserCache responses 2020-06-05 16:24:22 +10:00
search Fix broken PHPDoc comments that don't start with /** 2020-07-23 16:09:41 +00:00
session Fix some PSR12.Properties.ConstantVisibility.NotFound in tests/phpunit/ 2020-05-09 23:55:09 +00:00
DummyServicesTrait.php Add MediaWikiTitleCodec and NamespaceInfo to DummyServicesTrait 2021-05-04 19:10:23 +00:00
GhostFieldTestClass.php Forward-compat for merging CacheTime and ParserOutput mOptions 2020-11-10 07:09:41 -07:00
MockChangesListFilter.php RC Filters: Detect filters conflicts to by-pass db query 2017-04-18 22:49:58 -04:00
MockChangesListFilterGroup.php RCFilters: define consistent interface in ChangesListFilterGroup 2017-10-18 12:44:51 -07:00
MockHttpTrait.php phpunit: Don't redefine methods in traits 2021-03-23 12:59:34 +00:00
MockMessageLocalizer.php Use varargs for MessageLocalizer::msg and similar 2019-10-05 17:47:49 +00:00
MockServiceDependenciesTrait.php phpunit: Don't redefine methods in traits 2021-03-23 12:59:34 +00:00
MockTitleTrait.php Add MediaWikiTitleCodec and NamespaceInfo to DummyServicesTrait 2021-05-04 19:10:23 +00:00
NullHttpRequestFactory.php PHPUnit tests: prevent real Guzzle requests from tests. 2020-10-26 23:03:36 +01:00
NullMultiHttpClient.php Tests: Start marking some closures as static 2021-02-06 19:57:42 +00:00
TestLocalisationCache.php Tests: move some non-tests to /mocks 2021-04-14 07:16:05 +00:00
TestLogger.php Tests: move some non-tests to /mocks 2021-04-14 07:16:05 +00:00