MediaWiki REL1_33
LanguageRuTest.php
Go to the documentation of this file.
1<?php
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'few', 'many', 'other' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
17 }
18
23 public function testExplicitPlural() {
24 $forms = [ 'one', 'few', 'many', 'other', '12=dozen' ];
25 $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
26 $forms = [ 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' ];
27 $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
28 }
29
34 public function testGetPluralRuleType( $result, $value ) {
35 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
36 }
37
38 public static function providePlural() {
39 return [
40 [ 'one', 1 ],
41 [ 'many', 11 ],
42 [ 'one', 91 ],
43 [ 'one', 121 ],
44 [ 'few', 2 ],
45 [ 'few', 3 ],
46 [ 'few', 4 ],
47 [ 'few', 334 ],
48 [ 'many', 5 ],
49 [ 'many', 15 ],
50 [ 'many', 120 ],
51 ];
52 }
53
58 public function testPluralTwoForms( $result, $value ) {
59 $forms = [ '1=one', 'other' ];
60 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
61 }
62
63 public static function providePluralTwoForms() {
64 return [
65 [ 'one', 1 ],
66 [ 'other', 11 ],
67 [ 'other', 91 ],
68 [ 'other', 121 ],
69 ];
70 }
71
76 public function testGrammar( $result, $word, $case ) {
77 $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
78 }
79
80 public static function providerGrammar() {
81 return [
82 [
83 'Википедии',
84 'Википедия',
85 'genitive',
86 ],
87 [
88 'Викитеки',
89 'Викитека',
90 'genitive',
91 ],
92 [
93 'Викитеке',
94 'Викитека',
95 'prepositional',
96 ],
97 [
98 'Викисклада',
99 'Викисклад',
100 'genitive',
101 ],
102 [
103 'Викиверситета',
104 'Викиверситет',
105 'genitive',
106 ],
107 [
108 'Викискладе',
109 'Викисклад',
110 'prepositional',
111 ],
112 [
113 'Викиданных',
114 'Викиданные',
115 'prepositional',
116 ],
117 [
118 'Викиверситете',
119 'Викиверситет',
120 'prepositional',
121 ],
122 [
123 'русского',
124 'русский',
125 'languagegen',
126 ],
127 [
128 'немецкого',
129 'немецкий',
130 'languagegen',
131 ],
132 [
133 'иврита',
134 'иврит',
135 'languagegen',
136 ],
137 [
138 'эсперанто',
139 'эсперанто',
140 'languagegen',
141 ],
142 [
143 'русском',
144 'русский',
145 'languageprep',
146 ],
147 [
148 'немецком',
149 'немецкий',
150 'languageprep',
151 ],
152 [
153 'идише',
154 'идиш',
155 'languageprep',
156 ],
157 [
158 'эсперанто',
159 'эсперанто',
160 'languageprep',
161 ],
162 [
163 'по-русски',
164 'русский',
165 'languageadverb',
166 ],
167 [
168 'по-немецки',
169 'немецкий',
170 'languageadverb',
171 ],
172 [
173 'на иврите',
174 'иврит',
175 'languageadverb',
176 ],
177 [
178 'на эсперанто',
179 'эсперанто',
180 'languageadverb',
181 ],
182 [
183 'на языке гуарани',
184 'гуарани',
185 'languageadverb',
186 ],
187 ];
188 }
189}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Helping class to run tests using a clean language instance.
static providePlural()
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType
testPluralTwoForms( $result, $value)
providePluralTwoForms Language::convertPlural
static providerGrammar()
testPlural( $result, $value)
providePlural Language::convertPlural
testExplicitPlural()
Test explicit plural forms - n=FormN forms Language::convertPlural.
testGrammar( $result, $word, $case)
providerGrammar Language::convertGrammar
static providePluralTwoForms()