wiki.techinc.nl/tests/phpunit/includes/api
C. Scott Ananian 21ead7a98d Ensure LanguageCode::bcp47() returns a valid BCP 47 language code
MediaWiki uses a number of nonstandard codes which do not validate
according to the IANA language subtag registry.  Some of them have
the wrong semantics entirely: MediaWiki's `sr-ec` variant maps to
BCP 47 `sr-EC` which is "Serbian as used in Ethiopia" (!).

Extend LanguageCode::bcp47() to map our nonstandard codes to valid
BCP 47 language codes.  Export the mapping so that it can be used
in JavaScript's corresponding mw.language.bcp47() implementation
as well, and return the standard BCP 47 codes in the siteinfo
API.

Thanks to TheDJ (I10b4473c7e53f027812bbccf26bb47aec15fddfd) and
Fomafix (I93efc190714ba76247d30ba49fc21ae872fc3555) for previous
attempts at this!

Also removed a fixme for the name of 'Twi', dating back to 2004
(f59c3be23b) -- checking
tw.wikipedia.org it certainly appears that the autonym of 'Twi'
is correctly 'Twi'.

Tracking bugs for invalid language codes are T125073 and T145535.
Discussion of zh-XX => zh-HanX-XX mapping is at T198419.

This is a replay of an earlier merged patch,
8380f0173e, which had to be reverted
because it caused regressions in the Babel extension (T199941).

Bug: T34483
Bug: T106367
Bug: T120847
Depends-On: I27a5b8e45b34c6b57c1b612b11548001c88cd483
Change-Id: Iebbc604af21d7f2af9c1f1ab2574cb5f309bf6ed
2018-10-11 01:53:54 -04:00
..
format Improve ApiFormatJson test coverage 2018-10-08 13:42:20 +03:00
query ActorMigration: Remove possibility of read-both 2018-10-11 12:12:00 +11:00
ApiBaseTest.php Disable PHPUnit tests that fail under postgres 2018-08-01 22:22:15 +00:00
ApiBlockTest.php Minor cleanup in ApiBlockTest 2018-10-04 15:55:55 +03:00
ApiCheckTokenTest.php Add tests for ApiCheckToken 2018-01-01 02:06:59 +02:00
ApiClearHasMsgTest.php Add message to the assert of ApiClearHasMsgTest 2018-01-03 04:29:23 +02:00
ApiComparePagesTest.php ApiComparePages: Clean up handling of slot deletion 2018-08-31 11:26:07 -04:00
ApiContinuationManagerTest.php Use ::class to resolve class names in tests 2018-01-26 22:49:13 +01:00
ApiDeleteTest.php Update API tests to comply with the new backend for change tags 2018-09-04 21:50:46 +02:00
ApiDisabledTest.php Test ApiDisabled.php 2018-03-20 18:01:07 +02:00
ApiEditPageTest.php Update API tests to comply with the new backend for change tags 2018-09-04 21:50:46 +02:00
ApiErrorFormatterTest.php Suppress deprecation warnings for b/c use of UsageException::getMessageArray() 2018-09-24 17:18:00 -04:00
ApiLoginTest.php Use non-deprecated login in ApiLoginTest 2018-10-10 11:13:05 +03:00
ApiMainTest.php Deprecate $wgShowSQLErrors and $wgShowDBErrorBacktrace and make nonfunctional 2018-07-25 10:38:19 -05:00
ApiMessageTest.php Switch to librarized version of TestingAccessWrapper 2017-04-20 14:15:57 +00:00
ApiModuleManagerTest.php Use ::class to resolve class names in tests 2018-01-26 22:49:13 +01:00
ApiMoveTest.php Deprecate MediaWikiTestCase::stashMwGlobals 2018-10-07 19:39:47 +03:00
ApiOpenSearchTest.php Use ::class to resolve class names in tests 2018-01-26 22:49:13 +01:00
ApiOptionsTest.php ApiOptions: fix resetting some preferences to default 2018-10-01 15:48:19 -07:00
ApiPageSetTest.php build: Updating mediawiki/mediawiki-codesniffer to 16.0.0 2018-02-17 13:29:13 +01:00
ApiParseTest.php Deprecate the 'disabletidy' parameter for ApiParse 2018-09-24 17:40:51 -04:00
ApiPurgeTest.php Get rid of ApiTestCase::doLogin 2018-04-11 20:17:52 +03:00
ApiQueryAllPagesTest.php Get rid of ApiTestCase::doLogin 2018-04-11 20:17:52 +03:00
ApiQueryDisabledTest.php Add PHPUnit test to ApiQueryDisabled 2018-08-02 21:44:24 -04:00
ApiQueryPrefixSearchTest.php Ensure database is setup in MediaWikiTestCase::insertPage 2018-09-14 22:32:23 +02:00
ApiQueryRecentChangesIntegrationTest.php Merge "Add ability to filter based on rc_title in API" 2018-05-24 10:13:06 +00:00
ApiQuerySearchTest.php Avoid constructing Title objects in data providers 2018-09-03 16:36:49 +00:00
ApiQuerySiteinfoTest.php Ensure LanguageCode::bcp47() returns a valid BCP 47 language code 2018-10-11 01:53:54 -04:00
ApiQueryWatchlistIntegrationTest.php Re-namespace RevisionStore and RevisionRecord classes 2018-10-09 10:22:48 -04:00
ApiQueryWatchlistRawIntegrationTest.php Get rid of ApiTestCase::doLogin 2018-04-11 20:17:52 +03:00
ApiResultTest.php
ApiRevisionDeleteTest.php Fix RevDel API output for formatversion=2 2016-12-19 11:48:49 -05:00
ApiSetNotificationTimestampIntegrationTest.php Get rid of ApiTestCase::doLogin 2018-04-11 20:17:52 +03:00
ApiStashEditTest.php Deprecate MediaWikiTestCase::stashMwGlobals 2018-10-07 19:39:47 +03:00
ApiTestCase.php New helper ApiTestCase::setExpectedApiException() 2018-08-01 14:13:23 +03:00
ApiTestCaseUpload.php Drop deprecated EnableAPI and EnableWriteAPI settings 2018-04-18 00:30:34 +00:00
ApiTestContext.php
ApiTokensTest.php
ApiUnblockTest.php Test ApiUnblock 2018-10-05 00:23:01 +00:00
ApiUploadTest.php Rename ApiTestCaseUpload 2018-03-16 18:40:38 +01:00
ApiUploadTestCase.php Drop deprecated EnableAPI and EnableWriteAPI settings 2018-04-18 00:30:34 +00:00
ApiUsageExceptionTest.php Add @covers tags API tests without them 2017-12-27 17:50:06 +00:00
ApiUserrightsTest.php Deprecate MediaWikiTestCase::stashMwGlobals 2018-10-07 19:39:47 +03:00
ApiWatchTest.php Get rid of ApiTestCase::doLogin 2018-04-11 20:17:52 +03:00
generateRandomImages.php Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient 2018-05-30 18:06:13 -07:00
MockApi.php API: i18n for warnings and errors 2016-12-06 10:20:48 -05:00
MockApiQueryBase.php API: i18n for warnings and errors 2016-12-06 10:20:48 -05:00
RandomImageGenerator.php Fix PhanTypeMismatchDeclaredParam 2018-07-07 00:34:30 +00:00
UserWrapper.php
words.txt