wiki.techinc.nl/tests/phpunit
Timo Tijhof 3903c8cfec ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule
* Remove references to IDatabase from preloadModuleInfo() and with
  it the last reference to Rdbms in the ResourceLoader service
  (progressing T32956).

* Simplify WikiModule::preloadTitleInfo() so that it doesn't need
  an IDatabase object unless
  1) there are non-zero WikiModule objects in the batch, and
  2) there is a cache miss.

* Remove needless IDatabase parameters passed or mocked for this
  method. Note that WikiModule already had `@group Database` set
  since each WikiModule::getDB() is called and uses an unmocked
  database. The mocked database was only injected to satisfy the
  method signature.

Bug: T32956
Bug: T359522
Change-Id: I022f02d6e6bbae46c3258a7c07a1d6723506d8bc
2024-03-11 19:39:24 +01:00
..
data Add TranslationAliasesDirs to specify special page aliases in JSON 2024-03-06 18:13:28 +05:30
docs
includes ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule 2024-03-11 19:39:24 +01:00
integration/includes tests: Namespace and consolidate existing HTMLForm tests 2024-03-08 08:11:16 -05:00
maintenance maintenance: show broken replicas in getLagTimes 2024-02-27 22:52:14 +01:00
mocks PoolCounter: Adopt PSR logger in PoolCounter objects 2024-03-02 00:41:11 +00:00
structure Clean up tests 2024-02-12 09:25:25 +01:00
suites tests: Fix @covers and @coversDefaultClass to have leading \ 2024-02-16 22:43:56 +00:00
tests tests: Fix @covers and @coversDefaultClass to have leading \ 2024-02-16 22:43:56 +00:00
unit ResourceLoader: Add missing @group ResourceLoader to various cases 2024-03-09 21:25:44 +00:00
bootstrap.common.php Deprecate $wgCommandLineMode 2024-01-02 22:21:50 +01:00
bootstrap.integration.php phpunit: Deprecate suite.xml and composer phpunit:entrypoint 2023-12-21 08:22:35 +00:00
bootstrap.maintenance.php
bootstrap.php phpunit: Do not crash when paratest options are passed in 2024-02-25 20:06:18 +01:00
DynamicPropertyTestHelper.php
getPHPUnitExtensionsAndSkins.php
HamcrestPHPUnitIntegration.php
MediaWikiCoversValidator.php
MediaWikiDeprecatedConfigPHPUnitExtension.php phpunit: Deprecate suite.xml and composer phpunit:entrypoint 2023-12-21 08:22:35 +00:00
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php rdbms: replace truncate() with simpler truncateTable() method 2024-02-20 09:00:43 -08:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitExtension.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiTeardownPHPUnitExtension.php
MediaWikiTestCaseTrait.php build: Upgrade phpunit to 9.6.16 2024-02-25 00:04:54 +00:00
MediaWikiUnitTestCase.php
MWTestDox.php
phpunit.php Deprecate $wgCommandLineMode 2024-01-02 22:21:50 +01:00
README.md
ResourceLoaderTestCase.php tests: Namespace ResourceLoaderTestCase and friends 2024-02-16 21:32:22 +00:00
suite.xml phpunit: Deprecate suite.xml and composer phpunit:entrypoint 2023-12-21 08:22:35 +00:00
TestSelectQueryBuilder.php

MediaWiki PHPUnit tests

WARNING: Integration tests may be destructive and alter or remove parts of your local database. We try to use temporary tables where possible, but you must never run tests on a production server or on a wiki where you don't want to lose data.

Running tests

If you haven't already, run composer update (specifically without --no-dev) in the MediaWiki core directory. This will install PHPUnit.

To read about how to run specific tests, refer to:

https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/Running_the_tests

Writing tests

A guide to writing PHPUnit tests for MediaWiki can be found at:

https://www.mediawiki.org/wiki/Manual:PHP_unit_testing