wiki.techinc.nl/tests/phpunit
Sergio Gimeno 37985a198d ConditionalDefaultsLookup: allow to dynamically add conditions for evaluation
Why:
To facilitate the evaluation of conditions not directly
"known" by the lookup, eg: owned by extensions

What:
- Add ConditionalDefaultOptionsAddCondition hook which
runs before instantiating ConditionalDefaultsLookup allowing
to add conditions for evaluation in the $extraConditions
array.
- Evaluate the configured conditional default against the
 extra added conditions after evaluation of "known"
conditions.

Bug: T376918
Change-Id: Ife6f96397eafd61fdb40528aac315ddde1ef2774
2024-10-16 17:39:12 +02:00
..
data Merge "Add namespace to maintenance/includes classes" 2024-10-15 22:50:33 +00:00
docs Add namespace to maintenance/includes classes 2024-10-09 11:02:09 -04:00
includes Merge "[JsonCodec] Use wikimedia/json-codec to implement JsonCodec" 2024-10-16 00:54:33 +00:00
integration/includes Namespace all remaining classes in includes/parser 2024-10-15 23:54:32 +01:00
maintenance Merge "Add namespace to maintenance/includes classes" 2024-10-15 22:50:33 +00:00
mocks Merge "[JsonCodec] Use wikimedia/json-codec to implement JsonCodec" 2024-10-16 00:54:33 +00:00
structure Merge "tests: Validate Resources.php against ResourceModules schema" 2024-10-14 11:14:48 +00:00
suites
tests tests: Add missing documentation to class properties 2024-09-18 17:25:42 +00:00
unit ConditionalDefaultsLookup: allow to dynamically add conditions for evaluation 2024-10-16 17:39:12 +02:00
bootstrap.common.php
bootstrap.integration.php
bootstrap.maintenance.php
bootstrap.php
DynamicPropertyTestHelper.php
getPHPUnitExtensionsAndSkins.php
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
MediaWikiLoggerPHPUnitExtension.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiTeardownPHPUnitExtension.php
MediaWikiTestCaseTrait.php
MediaWikiUnitTestCase.php tests: Add missing documentation to class properties 2024-09-18 17:25:42 +00:00
MWTestDox.php
phpunit.php
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