Debian Codegraph @

tests/phpunit/includes/language/converters/ZhConverterTest.php

raw symbols SCIP
1 <?php
2
3 /**
4 * @group Language
5 * @covers \ZhConverter
6 */
7 class ZhConverterTest extends MediaWikiIntegrationTestCase {
8
9 use LanguageConverterTestTrait;
10
11 /**
12 * @dataProvider provideAutoConvertToAllVariants
13 */
14 public function testAutoConvertToAllVariants( $result, $value ) {
15 $this->assertEquals( $result,
16 $this->getLanguageConverter()->autoConvertToAllVariants( $value ) );
17 }
18
19 public static function provideAutoConvertToAllVariants() {
20 return [
21 // Plain hant -> hans
22 [
23 [
24 'zh' => '㑯',
25 'zh-hans' => '㑔',
26 'zh-hant' => '㑯',
27 'zh-cn' => '㑔',
28 'zh-hk' => '㑯',
29 'zh-mo' => '㑯',
30 'zh-my' => '㑔',
31 'zh-sg' => '㑔',
32 'zh-tw' => '㑯',
33 ],
34 '㑯'
35 ],
36 // Plain hans -> hant
37 [
38 [
39 'zh' => '㐷',
40 'zh-hans' => '㐷',
41 'zh-hant' => '傌',
42 'zh-cn' => '㐷',
43 'zh-hk' => '傌',
44 'zh-mo' => '傌',
45 'zh-my' => '㐷',
46 'zh-sg' => '㐷',
47 'zh-tw' => '傌',
48 ],
49 '㐷'
50 ],
51 // zh-cn specific
52 [
53 [
54 'zh' => '仲介',
55 'zh-hans' => '仲介',
56 'zh-hant' => '仲介',
57 'zh-cn' => '中介',
58 'zh-hk' => '仲介',
59 'zh-mo' => '仲介',
60 'zh-my' => '中介',
61 'zh-sg' => '中介',
62 'zh-tw' => '仲介',
63 ],
64 '仲介'
65 ],
66 // zh-hk specific
67 [
68 [
69 'zh' => '中文里',
70 'zh-hans' => '中文里',
71 'zh-hant' => '中文裡',
72 'zh-cn' => '中文里',
73 'zh-hk' => '中文裏',
74 'zh-mo' => '中文裏',
75 'zh-my' => '中文里',
76 'zh-sg' => '中文里',
77 'zh-tw' => '中文裡',
78 ],
79 '中文里'
80 ],
81 // zh-tw specific
82 [
83 [
84 'zh' => '甲肝',
85 'zh-hans' => '甲肝',
86 'zh-hant' => '甲肝',
87 'zh-cn' => '甲肝',
88 'zh-hk' => '甲肝',
89 'zh-mo' => '甲肝',
90 'zh-my' => '甲肝',
91 'zh-sg' => '甲肝',
92 'zh-tw' => 'A肝',
93 ],
94 '甲肝'
95 ],
96 // zh-tw overrides zh-hant
97 [
98 [
99 'zh' => '账',
100 'zh-hans' => '账',
101 'zh-hant' => '賬',
102 'zh-cn' => '账',
103 'zh-hk' => '賬',
104 'zh-mo' => '賬',
105 'zh-my' => '账',
106 'zh-sg' => '账',
107 'zh-tw' => '帳',
108 ],
109 '账'
110 ],
111 // zh-hk overrides zh-hant
112 [
113 [
114 'zh' => '一地里',
115 'zh-hans' => '一地里',
116 'zh-hant' => '一地裡',
117 'zh-cn' => '一地里',
118 'zh-hk' => '一地裏',
119 'zh-mo' => '一地裏',
120 'zh-my' => '一地里',
121 'zh-sg' => '一地里',
122 'zh-tw' => '一地裡',
123 ],
124 '一地里'
125 ],
126 ];
127 }
128 }