wiki.techinc.nl/tests/phpunit/mocks
Reedy e4bee84a27 AutoLoader: Use require_once rather than require
This was seen in WMF production during a train deployment, where namespacing of classes,
which had been serialized (for example CacheTime), along with our PSR-4 definitions may result
in cases where PHP tries to load the same PHP file more than once. Combined with non obvious
error messages, require_once gives us better behaviour and error messages.

More explicitly:
In T378006, the autoloader is entered from class_exists(), and the class has a filename
resolvable with PSR-4 which is already loaded by a non-PSR-4 class name. Using require_once
would allow class_exists() to return false in that case.

In T372500, the autoloader is entered from unserialize(). It looks like require_once would
just give you a more informative error message.

Bug: T378006
Bug: T372500
Change-Id: I928f29198af9baf81a3cae604b3adf41595c2176
(cherry picked from commit 03dd4ae7ae0e2ce7e45f0bf2cb913642eef842a8)
2024-10-24 01:36:18 +00:00
..
content tests: Use namespaced classes 2024-10-21 18:53:02 +02:00
filebackend tests: Use namespaced classes 2024-10-21 18:53:02 +02:00
filerepo tests: Use namespaced classes 2024-10-21 18:53:02 +02:00
json [JsonCodec] Use wikimedia/json-codec to implement JsonCodec 2024-10-15 20:09:51 -04:00
languages tests: Use namespaced classes 2024-10-21 18:53:02 +02:00
media
permissions Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
poolcounter mocks: Add missing documentation to class properties 2024-09-14 09:55:06 +02:00
search search: Add missing documentation to class properties 2024-09-07 21:56:00 +02:00
session mocks: Add missing documentation to class properties 2024-09-14 09:55:06 +02:00
BrokenClass.php HookContainer: allow registering broken callables. 2023-08-22 16:30:44 +00:00
BrokenClass2.php AutoLoader: Use require_once rather than require 2024-10-24 01:36:18 +00:00
BrokenClass3.php AutoLoader: Use require_once rather than require 2024-10-24 01:36:18 +00:00
DummyServicesTrait.php Make Message and MessageValue compatible 2024-10-19 15:00:07 +02:00
FakeQqxMessageLocalizer.php Make Message and MessageValue compatible 2024-10-19 15:00:07 +02:00
GhostFieldTestClass.php Serialization test cases: fix filename after ParserOutput namespacing 2024-05-17 17:07:47 -04:00
MockBlockTrait.php tests: Make use of ??= and ?? operators in various tests 2024-08-15 11:44:46 +02:00
MockChangesListFilter.php Replace usages of deprecated MWException 2023-06-06 17:05:32 +02:00
MockChangesListFilterGroup.php Migrate to IConnectionProvider methods in more places 2023-10-05 19:51:20 +02:00
MockDatabase.php Add namespace to remaining parts of Wikimedia\ObjectCache 2024-09-27 16:19:10 -04:00
MockEnvironment.php tests: Use namespaced classes (2) 2024-06-13 23:21:02 +02:00
MockHttpTrait.php Make MockHttpTrait::setService() compatible with MediaWikiUnitTestCase 2024-07-29 16:31:41 +02:00
MockMessageLocalizer.php Namespace MessageSpecifier under Wikimedia\Message\ 2024-07-28 14:21:32 +02:00
MockServiceDependenciesTrait.php MockServiceDependenciesTrait: Allow override param to be null 2024-09-27 18:28:33 +02:00
MockTitleTrait.php tests: Use namespaced classes (2) 2024-06-13 23:21:02 +02:00
NullGuzzleClient.php
NullHttpRequestFactory.php
NullMultiHttpClient.php Add namespace and deprecation alias to MultiHttpClient 2024-05-20 00:32:45 +03:30
TestLocalisationCache.php Use variable-length argument lists instead of func_get_args() 2024-08-16 18:42:01 +00:00
TestLogger.php mocks: Add missing documentation to class properties 2024-09-14 09:55:06 +02:00