wiki.techinc.nl/tests/phpunit
Amir Sarabadani c65e133f18 Language: Introduce getContentLanguageCode() service
And use that as much as possible. This makes bootstraping services much
faster since Language object is extremely heavy (specially to
initialize) and that's why in LanguageFactory it's behind a cache (see
LanguageFactory::getRawLanguage)

At the same time, most uses of Language object only need the language
code (after normalization and mapping and validation) and this allows
such change to happen fast and way more decoupled from Language object
that has more than 100 methods.

Bug: T376565
Change-Id: I1c3d94454896842939dfaad8cbf742e5a3ae5438
2024-10-16 11:02:01 +02:00
..
data Test findDeprecated.php 2024-10-15 17:08:23 +00:00
docs
includes Remove MediaWikiVersionFetcher 2024-10-14 12:00:08 +00:00
integration/includes tests: Remove global state from Rest Handler tests 2024-10-11 23:18:22 +02:00
maintenance Merge "Test findDeprecated.php" 2024-10-15 17:41:25 +00:00
mocks Add namespace to remaining parts of Wikimedia\ObjectCache 2024-09-27 16:19:10 -04:00
structure Merge "tests: Validate Resources.php against ResourceModules schema" 2024-10-14 11:14:48 +00:00
suites tests: Make use of ??= and ?? operators in various tests 2024-08-15 11:44:46 +02:00
tests tests: Add missing documentation to class properties 2024-09-18 17:25:42 +00:00
unit Language: Introduce getContentLanguageCode() service 2024-10-16 11:02:01 +02:00
bootstrap.common.php
bootstrap.integration.php
bootstrap.maintenance.php
bootstrap.php Add MediaWiki\Registration namespace to registration classes 2024-08-10 10:08:22 +00:00
DynamicPropertyTestHelper.php
getPHPUnitExtensionsAndSkins.php Add MediaWiki\Registration namespace to registration classes 2024-08-10 10:08:22 +00:00
HamcrestPHPUnitIntegration.php
JsonSchemaAssertionTrait.php REST: validate JSON in tests 2024-09-20 15:42:32 +00:00
MediaWikiCoversValidator.php
MediaWikiDeprecatedConfigPHPUnitExtension.php
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php build: Use inline ignore for MediaWiki.Usage.DeprecatedGlobalVariables 2024-09-26 18:15:32 +00:00
MediaWikiLangTestCase.php Use MediaWikiIntegrationTestCase::getConfVar in tests 2024-08-06 12:52:34 +00:00
MediaWikiLoggerPHPUnitExtension.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiTeardownPHPUnitExtension.php
MediaWikiTestCaseTrait.php Merge "tests: Disallow using setFakeTime() in PHPUnit data providers" 2024-08-20 22:43:19 +00:00
MediaWikiUnitTestCase.php tests: Add missing documentation to class properties 2024-09-18 17:25:42 +00:00
MWTestDox.php
phpunit.php Add MediaWiki\Registration namespace to registration classes 2024-08-10 10:08:22 +00:00
README.md
ResourceLoaderTestCase.php tests: Add missing documentation to class properties 2024-09-18 17:25:42 +00:00
suite.xml
TestSelectQueryBuilder.php Expand tests for rename user maintenance scripts 2024-10-08 21:51:59 +01:00

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