wiki.techinc.nl/tests/phpunit/maintenance
Daimona Eaytoy 485e47ff10 tests: Avoid database usage when possible
We would like to remove DB access in non-database PHPUnit tests. As a
first step, avoid database usage in tested code when possible. In
particular:
- In NameTableStoreFactory, avoid domain ID normalization if the
  provided ID is already false.
- In SpecialDoubleRedirects, do not acquire a DB connection until it's
  needed (which is just one place).
- Use editPage() in TitleDefTest instead of a DIY implementation, and
  add `@group Database` accordingly.
- Avoid parsing titles in ContentHandler tests that don't need to parse
  titles. Among the many dependencies of parsing titles is the interwiki
  lookup, which requires DB access.
- Also remove test cases that used the "Gadget" namespace; it doesn't
  exist in core, so these pages were actually in the mainspace.
- Mock the database in CategoriesRdfTest. The only two methods that use
  the database were already being mocked.
- Add `@group Database` to test classes that are intentionally using the
  Database, mainly via getTestUser().

Bug: T155147
Change-Id: I9385fe14cfeb6b7b7378cc322d510034c4ee0711
2023-07-31 00:46:13 +00:00
..
BackupDumperLoggerTest.php Reorg: Namespace the Title class 2023-03-02 08:46:53 -05:00
BackupDumperPageTest.php unittests: rename some files to match the class name 2023-02-08 07:27:44 +00:00
BaseDumpTest.php tests: Rename various test files to match the class 2023-01-22 19:43:52 +00:00
BenchmarkerTest.php Benchmarker: Substitute long arguments in generated case names 2023-01-10 16:50:00 +00:00
CategoriesRdfTest.php tests: Avoid database usage when possible 2023-07-31 00:46:13 +00:00
CategoryChangesAsRdfTest.php tests: Pass Title to editPage() when already parsed 2023-07-15 00:45:47 +02:00
DeleteAutoPatrolLogsTest.php tests: Resolve maintenance phpunit filename deprecation errors 2023-07-09 22:34:35 +02:00
DeleteUserEmailTest.php phpunit: Avoid TestUser in non-database tests 2023-07-29 14:26:50 +00:00
DumpAsserter.php Just another 80 or so PHPStorm inspection fixes (#4) 2023-03-25 00:39:06 +00:00
DumpTestCase.php Replace deprecated MWException 2023-06-09 17:21:12 +02:00
FetchTextTest.php tests: Resolve maintenance phpunit filename deprecation errors 2023-07-09 22:34:35 +02:00
MaintenanceBaseTestCase.php
MaintenanceTest.php tests: Make some PHPUnit data providers static 2023-03-24 02:53:57 +00:00
PageDumpTestDataTrait.php tests: Use Title::makeTitle instead of Title::newFromText 2023-06-19 21:54:57 +02:00
TextPassDumperDatabaseTest.php tests: Make some PHPUnit data providers static 2023-05-20 01:05:27 +02:00
xml.xsd