wiki.techinc.nl/tests/phpunit/includes/api
Tim Starling 20d06b34bb Safer autoloading with respect to file-scope code
Many files were in the autoloader despite having potentially harmful
file-scope code.

* Exclude all CommandLineInc maintenance scripts from the autoloader.
* Introduce  "NO_AUTOLOAD" tag which excludes the file containing it
  from the autoloader. Use it on CommandLineInc.php and a few
  suspicious-looking files without classes in case they are refactored
  to add classes in the future.
* Add a test which parses all non-PSR4 class files and confirms that
  they do not contain dangerous file-scope code. It's slow (15s) but
  its results were enlightening.
* Several maintenance scripts define constants in the file scope,
  intending to modify the behaviour of MediaWiki. Either move the
  define() to a later setup function, or protect with NO_AUTOLOAD.
* Use require_once consistently with Maintenance.php and
  doMaintenance.php, per the original convention which is supposed to
  allow one maintenance script to use the class of another maintenance
  script. Using require breaks autoloading of these maintenance class
  files.
* When Maintenance.php is included, check if MediaWiki has already
  started, and if so, return early. Revert the fix for T250003 which
  is incompatible with this safety measure. Hopefully it was superseded
  by splitting out the class file.
* In runScript.php add a redundant PHP_SAPI check since it does some
  things in file-scope code before any other check will be run.
* Change the if(false) class_alias(...) to something more hackish and
  more compatible with the new test.
* Some site-related scripts found Maintenance.php in a non-standard way.
  Use the standard way.
* fileOpPerfTest.php called error_reporting(). Probably debugging code
  left in; removed.
* Moved mediawiki.compress.7z registration from the class file to the
  caller.

Change-Id: I1b1be90343a5ab678df6f1b1bdd03319dcf6537f
2021-01-11 11:59:36 +11:00
..
format Expose portlet data in SkinMustache 2020-09-22 14:06:29 -07:00
query Deprecate InterwikiLoadPrefix hook 2020-12-21 19:28:48 +00:00
Validator api: Add new 'raw' parameter type which avoids Unicode NFC normalization 2020-12-23 18:24:34 +00:00
ApiBaseTest.php [ApiBaseTest] Set apihighlimits permission to false 2020-10-30 18:50:00 +00:00
ApiBlockInfoTraitTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiBlockTest.php Introduce backend class for blocking users 2020-09-22 14:14:01 +01:00
ApiChangeContentModelTest.php Remove documentation that literally repeats the code 2020-10-27 19:20:26 +00:00
ApiCheckTokenTest.php Add tests for ApiCheckToken 2018-01-01 02:06:59 +02:00
ApiClearHasMsgTest.php Use new TalkPageNotificationManager 2020-05-15 12:35:45 -04:00
ApiComparePagesTest.php Create diff markers with CSS 2020-12-30 12:52:08 +00:00
ApiContinuationManagerTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiCSPReportTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
ApiDeleteTest.php Fix tests assume badaccess-groups message in singular form 2020-10-30 17:20:54 +01:00
ApiDisabledTest.php Replace setExpectedException with two args 2019-10-05 16:14:05 +00:00
ApiEditPageTest.php Skip undo related phpunit tests when diff3 is missing 2020-12-12 20:22:17 +00:00
ApiErrorFormatterTest.php Remove Language::factory and getParentLanguage use 2019-10-27 12:34:28 +02:00
ApiLoginTest.php Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
ApiLogoutTest.php Swap out uses of User->isLoggedIn() with ->isRegistered() 2020-12-22 03:13:37 +00:00
ApiMainTest.php Fix hang of ApiMainTest 2020-12-16 15:39:19 +11:00
ApiMessageTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiModuleManagerTest.php Use SpecialPageFactory to create special pages in ApiFeedRecentChanges 2020-11-03 18:11:46 +00:00
ApiMoveTest.php Deprecate DatabaseBlock methods moved to DatabaseBlockStore 2020-09-13 22:17:27 +00:00
ApiOpenSearchTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiOptionsTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
ApiPageSetTest.php ApiPageSet: Avoid infinite loop when merging redirects 2020-10-08 10:00:45 -07:00
ApiParseTest.php Introduce RevisionOutputCache 2020-12-14 16:50:28 +00:00
ApiProtectTest.php Add watchlist expiry support to applicable APIs 2020-07-13 18:18:15 -04:00
ApiPurgeTest.php Make use of PHPUnit's assertCount feature where possible 2020-03-02 15:58:41 +00:00
ApiResultTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiRevisionDeleteTest.php Deprecate DatabaseBlock methods moved to DatabaseBlockStore 2020-09-13 22:17:27 +00:00
ApiRollbackTest.php Add watchlist expiry support to applicable APIs 2020-07-13 18:18:15 -04:00
ApiSetNotificationTimestampIntegrationTest.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
ApiStashEditTest.php Skip undo related phpunit tests when diff3 is missing 2020-12-12 20:22:17 +00:00
ApiTestCase.php Don't access $wgRequest from User 2020-12-16 12:21:00 +11:00
ApiTestContext.php Remove documentation that literally repeats the code 2020-10-27 19:20:26 +00:00
ApiTokensTest.php Remove usages of deprecated User::getRights. 2019-08-20 19:43:54 -07:00
ApiUnblockTest.php Deprecate DatabaseBlock methods moved to DatabaseBlockStore 2020-09-13 22:17:27 +00:00
ApiUndeleteTest.php Add watchlist expiry support to applicable APIs 2020-07-13 18:18:15 -04:00
ApiUploadTest.php Add watchlist expiry support to applicable APIs 2020-07-13 18:18:15 -04:00
ApiUploadTestCase.php Use MediaWikiServices::getRepoGroup in api related classes 2020-04-11 23:58:00 +00:00
ApiUsageExceptionTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
ApiUserrightsTest.php [ApiUserrightsTest] Start with empty $wgAddGroups/$wgRemoveGroups 2020-10-30 16:36:02 +01:00
ApiWatchlistTraitTest.php [API] Ignore watchlist preferences for bot users 2020-12-22 22:28:28 +01:00
ApiWatchTest.php More misc test cleanup 2020-12-24 00:52:06 +00:00
generateRandomImages.php Safer autoloading with respect to file-scope code 2021-01-11 11:59:36 +11:00
MockApi.php API: i18n for warnings and errors 2016-12-06 10:20:48 -05:00
MockApiQueryBase.php Replace some oldskool @see with @inheritDoc 2019-11-08 18:00:27 +00:00
RandomImageGenerator.php Update a lot of unspecific "array" types in PHPDocs 2020-10-28 11:01:33 +01:00
UserWrapper.php Fix numerous class/function casing 2016-03-18 23:14:49 +00:00
words.txt