Commit graph

4 commits

Author SHA1 Message Date
James D. Forrester
4bae64d1c7 Namespace includes/context
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
2024-02-08 11:07:01 -05:00
Daimona Eaytoy
f00ca670bc Fix DB usage in non-database tests
Some non-database tests are currently accessing the database. Fixing
them means either avoiding the DB access if it's possible and makes
sense for the test, or adding the `Database` group otherwise. In
particular:

- Replace global/static functions with services in a couple places to
  make testing easier.
- RevisionRendererTest needs to be in the Database group due to heavy
  global state usage (including DB) by Parser
- ActionFactoryIntegrationTest and SpecialPageFatalTest should be in
  the database group because they test many different classes, and some
  of which may use the database in the tested methods.
- SpecialUserLogoutTest must be in the database group because of User.
- Some pager tests are using wfGetDB directly.

Change-Id: I96eb2acf9a2cbfd17e81225db2773d5e8e30260b
2023-07-21 13:52:47 +02:00
James D. Forrester
ad06527fb4 Reorg: Namespace the Title class
This is moderately messy.

Process was principally:

* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
  xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
  xargs rg --files-with-matches 'Title\b' | \
  xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix

Then manual fix-ups for a few files that don't have any use statements.

Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
2023-03-02 08:46:53 -05:00
Umherirrender
4d8cc1bfff tests: Add ActionFactoryIntegrationTest
Test all action specs to be valid, avoid T326275

Change-Id: I72555f892861f38b61e4ddb2e8b338c62d24f041
2023-01-05 00:10:20 +01:00