MediaWiki REL1_30
LanguageBe_taraskTest.php
Go to the documentation of this file.
1<?php
2
3// @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps
5 // @codingStandardsIgnoreEnd
12 $this->assertEquals( 'be-tarask',
13 $this->getLang()->getCode()
14 );
15 }
16
22 $this->assertEquals(
23 "'",
24 $this->getLang()->normalizeForSearch( '’' ),
25 'T25156: U+2019 conversion to U+0027'
26 );
27 }
28
33 public function testCommafy() {
34 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
35 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
36 }
37
43 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
44 }
45
50 public function testPlural( $result, $value ) {
51 $forms = [ 'one', 'few', 'many', 'other' ];
52 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
53 }
54
59 public function testGetPluralRuleType( $result, $value ) {
60 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
61 }
62
63 public static function providePlural() {
64 return [
65 [ 'one', 1 ],
66 [ 'many', 11 ],
67 [ 'one', 91 ],
68 [ 'one', 121 ],
69 [ 'few', 2 ],
70 [ 'few', 3 ],
71 [ 'few', 4 ],
72 [ 'few', 334 ],
73 [ 'many', 5 ],
74 [ 'many', 15 ],
75 [ 'many', 120 ],
76 ];
77 }
78
83 public function testPluralTwoForms( $result, $value ) {
84 $forms = [ '1=one', 'other' ];
85 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
86 }
87
88 public static function providePluralTwoForms() {
89 return [
90 [ 'other', 0 ],
91 [ 'one', 1 ],
92 [ 'other', 11 ],
93 [ 'other', 91 ],
94 [ 'other', 121 ],
95 ];
96 }
97}
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.