wiki.techinc.nl/tests/phpunit
mainframe98 ffed58bcef Make ExtensionJsonTestBase more extendable
Extensions or skins might want to define their own tests and not
giving them access to the cached JSON is limiting. Because the
method was private for a reason, make it final to prevent overriding
it and breaking things in weird ways.

Also, now that we are on PHP 7.4, use JSON_THROW_ON_ERROR to allow
PHPUnit to have clearer error messages when extension.json/skin.json
is not valid JSON.

Follows-Up: I47757958e54d5e9d47a309b4037ff47dd9c1d382
Change-Id: I5819da9c59499d1752057f79b1855872064ff32e
2023-03-28 20:38:58 +02:00
..
data Fix some PHPStorm inspections (#1) 2023-03-25 00:19:33 +00:00
docs
includes Merge "Make ApiOptions unavailable to temporary users" 2023-03-28 15:52:55 +00:00
integration/includes Make ExtensionJsonTestBase more extendable 2023-03-28 20:38:58 +02:00
maintenance Just another 80 or so PHPStorm inspection fixes (#4) 2023-03-25 00:39:06 +00:00
mocks Fix some typos 2023-03-21 15:58:09 +01:00
structure tests: Make some PHPUnit data providers static 2023-03-24 02:53:57 +00:00
suites Just another 80 or so PHPStorm inspection fixes (#4) 2023-03-25 00:39:06 +00:00
tests tests: Make some PHPUnit data providers static 2023-03-24 02:53:57 +00:00
unit Merge "mime: Add support for 'font/woff' and 'font/woff2' mime type" 2023-03-28 09:40:07 +00:00
bootstrap.maintenance.php
bootstrap.php phpunit: Check if composer dependencies are up-to-date 2023-03-09 18:26:06 -05:00
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php
MediaWikiCliOptions.php
MediaWikiCoversValidator.php
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php profiler: Add ProfilingContext class 2023-03-23 00:08:49 +00:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitExtension.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiTestCaseTrait.php
MediaWikiUnitTestCase.php
MWTestDox.php
phpunit.php phpunit: Check if composer dependencies are up-to-date 2023-03-09 18:26:06 -05:00
README.md
ResourceLoaderTestCase.php
suite.xml phpunit: Lower report limit to 10 slowest tests 2023-03-09 14:08:38 +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