wiki.techinc.nl/tests/phpunit/data/MaintenanceRunner
Dreamy Jazz 58311b0a8d Use fake maintenance scripts in MaintenanceRunnerTest where necessary
Why:
* The MaintenanceRunnerTest class tests using real maintenance
  scripts and the code being tested can include the maintenance
  script files.
* However, if running all tests together (such as when generating
  test coverage) the maintenance scripts may have already been
  loaded by integration tests that exist for those scripts.
* Instead of fixing the specific instances, we should instead
  ensure that (where necessary) the MaintenanceRunnerTest tests
  using fake maintenance scripts only loaded by that test class.
* Doing this prevents the files from being loaded anywhere else
  and ensures that the tests should not fail in this way again.

What:
* Update MaintenanceRunner::expandScriptFile to move the use of
  MS_INSTALL_PATH to a protected method that can then be mocked
  in MaintenanceRunnerTest.
* Update MaintenanceRunnerTest to use fake maintenance scripts
  where necessary. This includes:
** No longer setting the current working directory as the
   MW_INSTALL_PATH, but instead set it as __DIR__.
** Creating several fake maintenance scripts to replace the uses
   of the real ones.
** Updating the data providers to reflect the changes.

Bug: T371188
Change-Id: Ifacdcb8de5af53d2d5f4ed354af0d209384d7325
2024-08-08 13:02:22 +00:00
..
FakeExtension/maintenance
maintenance