wiki.techinc.nl/tests/phpunit
Roan Kattouw e274ef9e55 mediawiki.skin.defaults.less: Add neutral values for all Codex tokens
Skins can choose to provide these values using Codex tokens by importing
one of the Codex themes in their mediawiki.skin.variables.less. To
guarantee that the variables corresponding to Codex tokens always exist,
provide neutral fallback values for all of them in
mediawiki.skin.defaults.less.

To ensure that mediawiki.skin.defaults.less doesn't get out of sync with
Codex when new tokens are added, add a structure test that verifies that
every Codex token has a corresponding default variable. This isn't an
ideal system, and we'll be able to handle this better once Codex has a
real theme system (T286689) and we can upstream this set of neutral
values into Codex itself.

For now, keep (almost) all existing variables' values the same. This
means overriding some of the values from Codex. We should consider whether
some of these should be changed in a follow-up patch. The only values
changed in this patch are:
- @max-width-breakpoint-tablet from calc(719px) to 719px (no visual
  impact; but we should consider changing this to 1119px which is what
  it is in Codex)

Bug: T325237
Change-Id: I04f9e48a1cf9dee915cf51e1e12b17ff0a595a06
2023-03-15 17:23:51 -07:00
..
data Merge "Drop 1.34 db updates" 2023-02-15 12:51:34 +00:00
docs
includes Merge "tests: Allow $subPage to be null" 2023-03-14 22:35:31 +00:00
integration/includes ParsoidHandlerTest: check no etag is emitted perdefault 2023-03-14 14:05:16 +00:00
maintenance Reorg: Namespace the Title class 2023-03-02 08:46:53 -05:00
mocks A fake MessageLocalizer for use in unit tests 2023-03-15 17:55:51 +01:00
structure mediawiki.skin.defaults.less: Add neutral values for all Codex tokens 2023-03-15 17:23:51 -07:00
suites Followup to 02d13afa: Respect parsoid-compatible options in CLI runs 2022-10-25 17:05:22 -05:00
tests Reorg: Namespace the Title class 2023-03-02 08:46:53 -05:00
unit Merge "A fake MessageLocalizer for use in unit tests" 2023-03-15 19:05:40 +00:00
bootstrap.maintenance.php Revert "phpunit: Default to vendor/bin/phpunit, remove suites.xml" 2022-06-09 14:15:54 +00:00
bootstrap.php profiler: Inject $wgProfiler from Setup.php to Profiler 2022-11-09 02:58:19 +00:00
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php tests: Fix types in documentation by adding use statements 2022-05-29 07:11:15 +00:00
MediaWikiCliOptions.php Improve ObjectCache integration tests 2022-02-11 10:20:33 +11:00
MediaWikiCoversValidator.php tests: Upgrade PHPUnit from 8.5+ to 9.5+ 2022-10-08 02:03:55 +02:00
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php Treat $wgHooks as a regular setting 2023-03-09 10:20:44 +01:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitExtension.php phpunit: Add PHPUNIT_LOGS flag 2023-02-08 22:15:32 -08:00
MediaWikiPHPUnitResultPrinter.php tests: Upgrade PHPUnit from 8.5+ to 9.5+ 2022-10-08 02:03:55 +02:00
MediaWikiTestCaseTrait.php tests: Replace checkPHPExtension() with @requires annotations 2022-10-23 20:47:14 -04:00
MediaWikiUnitTestCase.php AutoLoader: Drop support for $wgAutoloadAttemptLowercase 2022-12-04 02:38:57 -05:00
MWTestDox.php phpunit: Restore default progress reporter and add MWTestDox option 2022-06-12 19:22:57 +00:00
phpunit.php Revert "phpunit: Default to vendor/bin/phpunit, remove suites.xml" 2022-06-09 14:15:54 +00:00
README.md phpunit: Update and simplify README 2022-03-31 19:37:33 +01:00
ResourceLoaderTestCase.php tests: Handle dynamic created properties on test classes 2023-01-13 21:03:42 +00:00
suite.xml tests: Move all language converter tests into /includes/ 2023-02-01 20:10:56 +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