This was calling wfTmpDir(), which depended on the value
of $wgTmpDirectory being not null, but the parent class of the
test sets the entire environment to null.
Bug: T313663
Change-Id: I37f224195a5aacbd69454cc406fbd06f4e71a133
createMock() does the same, but is much easier to read.
A small difference is that some of the replacements made in this
patch didn't use disableOriginalConstructor() before. In case this
was relevant we should see the respective test fail. If not we can
save some CPU cycles and skip these constructors.
Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
Per [[mw:CC/PHP]], use of file existence check is an anti-pattern
because it is subject to race conditions (e.g. parallel tests), and
needlessly slower than just performing the operation directly.
If code needs to do something in response to the file not existing,
then one can check the return value instead. This matches how other
we do it in tests and other production code.
Follows-up I3b2bac837c.
Change-Id: I4944bead2629e9d1e89cf53fa3e710a617f63726
Only needed MediaWikiIntegrationTestCase for the handling
of temporary files, but its acceptable to create and manipulate
files in unit tests too.
Change-Id: I3b2bac837c943f1210cc1b804f1afbbb3ecab0f3
2021-08-05 05:43:54 +00:00
Renamed from tests/phpunit/includes/ReadOnlyModeTest.php (Browse further)