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