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 |
||
|---|---|---|
| .. | ||
| data | ||
| docs | ||
| includes | ||
| integration/includes | ||
| maintenance | ||
| mocks | ||
| structure | ||
| suites | ||
| tests | ||
| unit | ||
| bootstrap.maintenance.php | ||
| bootstrap.php | ||
| HamcrestPHPUnitIntegration.php | ||
| LessFileCompilationTest.php | ||
| MediaWikiCliOptions.php | ||
| MediaWikiCoversValidator.php | ||
| MediaWikiGroupValidator.php | ||
| MediaWikiIntegrationTestCase.php | ||
| MediaWikiLangTestCase.php | ||
| MediaWikiLoggerPHPUnitExtension.php | ||
| MediaWikiPHPUnitResultPrinter.php | ||
| MediaWikiTestCaseTrait.php | ||
| MediaWikiUnitTestCase.php | ||
| MWTestDox.php | ||
| phpunit.php | ||
| README.md | ||
| ResourceLoaderTestCase.php | ||
| suite.xml | ||
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: