MediaWiki REL1_33
LanguageBe_taraskTest.php
Go to the documentation of this file.
1<?php
2
3// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
8 // phpcs:enable
15 $this->assertEquals( 'be-tarask',
16 $this->getLang()->getCode()
17 );
18 }
19
25 $this->assertEquals(
26 "'",
27 $this->getLang()->normalizeForSearch( '’' ),
28 'T25156: U+2019 conversion to U+0027'
29 );
30 }
31
36 public function testCommafy() {
37 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
38 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
39 }
40
46 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
47 }
48
53 public function testPlural( $result, $value ) {
54 $forms = [ 'one', 'few', 'many', 'other' ];
55 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
56 }
57
62 public function testGetPluralRuleType( $result, $value ) {
63 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
64 }
65
66 public static function providePlural() {
67 return [
68 [ 'one', 1 ],
69 [ 'many', 11 ],
70 [ 'one', 91 ],
71 [ 'one', 121 ],
72 [ 'few', 2 ],
73 [ 'few', 3 ],
74 [ 'few', 4 ],
75 [ 'few', 334 ],
76 [ 'many', 5 ],
77 [ 'many', 15 ],
78 [ 'many', 120 ],
79 ];
80 }
81
86 public function testPluralTwoForms( $result, $value ) {
87 $forms = [ '1=one', 'other' ];
88 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
89 }
90
91 public static function providePluralTwoForms() {
92 return [
93 [ 'other', 0 ],
94 [ 'one', 1 ],
95 [ 'other', 11 ],
96 [ 'other', 91 ],
97 [ 'other', 121 ],
98 ];
99 }
100}
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
testPluralTwoForms( $result, $value)
providePluralTwoForms Language::convertPlural
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType
testPlural( $result, $value)
providePlural Language::convertPlural
testBeTaraskTestsUsesBeTaraskCode()
Make sure the language code we are given is indeed be-tarask.
Helping class to run tests using a clean language instance.