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)