Add the same no-arg options for language code that
{{#dir}} and {{#bcp47}} have, for consistency:
* `{{#language}}` will return the name of the *target language*
(for articles, the content language; for messages, the user language)
The default value for the "in language" argument should be the autonym.
This was working previously but only via a baroque code flow path for
invalid language codes. Make this a bit clearer and add tests.
Since non-autonym language code translations are added via the
[[Extension:CLDR]] in production, hook LanguageGetTranslatedLanguageNames
in the ParserTestRunner to ensure that we can test this.
Followup-To: Ice1c671c5b3cc077d2bb80ea5dc25c5eabbfeb36
Followup-To: I19c3e91a924e080f37dc95a0d4e61493583b533e
Change-Id: Ibf6e7f194cc056eadb48a5ad8e6d01a761d9351c
|
||
|---|---|---|
| .. | ||
| AnsiTermColorer.php | ||
| badCharacters.txt | ||
| comments.txt | ||
| DbTestPreviewer.php | ||
| DbTestRecorder.php | ||
| definitionLists.txt | ||
| DjVuSupport.php | ||
| DummyTermColorer.php | ||
| editTests.php | ||
| extLinks.txt | ||
| fuzzTest.php | ||
| headings.txt | ||
| indentPre.txt | ||
| indicators.txt | ||
| interlanguageLinks.txt | ||
| interwikiLinks.txt | ||
| langParserTests.txt | ||
| legacyHeadings.txt | ||
| legacyMedia.txt | ||
| magicLinks.txt | ||
| magicWords.txt | ||
| media.txt | ||
| MultiTestRecorder.php | ||
| ParserTestMockParser.php | ||
| ParserTestParserHook.php | ||
| ParserTestPrinter.php | ||
| ParserTestResult.php | ||
| ParserTestResultNormalizer.php | ||
| ParserTestRunner.php | ||
| parserTests.php | ||
| parserTests.txt | ||
| pfeqParserTests.txt | ||
| PhpunitTestRecorder.php | ||
| preprocessor.txt | ||
| preTags.txt | ||
| pst.txt | ||
| pWrapping.txt | ||
| quotes.txt | ||
| README | ||
| redirects.txt | ||
| tables.txt | ||
| TestFileEditor.php | ||
| TestRecorder.php | ||
| wtEscaping.txt | ||
Parser tests can be run either via PHPUnit or by using the standalone parserTests.php in this directory. The standalone version provides more options. To run parser tests via PHPUnit: $ composer phpunit -- --testsuite parsertests You can optionally filter by title using --filter, e.g. composer phpunit -- --testsuite parsertests --filter="T6400"