X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Flanguages%2FLanguageCodeTest.php;h=d8251bc6f65f038c21d1de340096f2fe3e8dff96;hb=b1afc34fc8ace4dd5f54dca1ccec81d4fa7b8144;hp=544a063566c8f78e655a1045d45c78a3f5a0e82f;hpb=ad9f5164c8982bac3e4651aa83338ed97b9bfadd;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/languages/LanguageCodeTest.php b/tests/phpunit/languages/LanguageCodeTest.php index 544a063566..d8251bc6f6 100644 --- a/tests/phpunit/languages/LanguageCodeTest.php +++ b/tests/phpunit/languages/LanguageCodeTest.php @@ -54,14 +54,18 @@ class LanguageCodeTest extends PHPUnit\Framework\TestCase { * @dataProvider provideLanguageCodes() */ public function testBcp47( $code, $expected ) { + $this->assertEquals( $expected, LanguageCode::bcp47( $code ), + "Applying BCP 47 standard to '$code'" + ); + $code = strtolower( $code ); $this->assertEquals( $expected, LanguageCode::bcp47( $code ), - "Applying BCP47 standard to lower case '$code'" + "Applying BCP 47 standard to lower case '$code'" ); $code = strtoupper( $code ); $this->assertEquals( $expected, LanguageCode::bcp47( $code ), - "Applying BCP47 standard to upper case '$code'" + "Applying BCP 47 standard to upper case '$code'" ); } @@ -155,6 +159,41 @@ class LanguageCodeTest extends PHPUnit\Framework\TestCase { // de-419-DE // a-DE // ar-a-aaa-b-bbb-a-ccc + + # Non-standard and deprecated language codes used by MediaWiki + [ 'als', 'gsw' ], + [ 'bat-smg', 'sgs' ], + [ 'be-x-old', 'be-tarask' ], + [ 'fiu-vro', 'vro' ], + [ 'roa-rup', 'rup' ], + [ 'zh-classical', 'lzh' ], + [ 'zh-min-nan', 'nan' ], + [ 'zh-yue', 'yue' ], + [ 'cbk-zam', 'cbk' ], + [ 'de-formal', 'de-x-formal' ], + [ 'eml', 'egl' ], + [ 'en-rtl', 'en-x-rtl' ], + [ 'es-formal', 'es-x-formal' ], + [ 'hu-formal', 'hu-x-formal' ], + [ 'kk-Arab', 'kk-Arab' ], + [ 'kk-Cyrl', 'kk-Cyrl' ], + [ 'kk-Latn', 'kk-Latn' ], + [ 'map-bms', 'jv-x-bms' ], + [ 'mo', 'ro-Cyrl-MD' ], + [ 'nrm', 'nrf' ], + [ 'nl-informal', 'nl-x-informal' ], + [ 'roa-tara', 'nap-x-tara' ], + [ 'simple', 'en-simple' ], + [ 'sr-ec', 'sr-Cyrl' ], + [ 'sr-el', 'sr-Latn' ], + [ 'zh-cn', 'zh-Hans-CN' ], + [ 'zh-sg', 'zh-Hans-SG' ], + [ 'zh-my', 'zh-Hans-MY' ], + [ 'zh-tw', 'zh-Hant-TW' ], + [ 'zh-hk', 'zh-Hant-HK' ], + [ 'zh-mo', 'zh-Hant-MO' ], + [ 'zh-hans', 'zh-Hans' ], + [ 'zh-hant', 'zh-Hant' ], ]; }