Move ResultWrapper subclasses to Rdbms
[mediawiki.git] / tests / phpunit / languages / classes / LanguageBe_taraskTest.php
blob26db1062a1746a86e323b535f9f4d8cbfc61b61f
1 <?php
3 // @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps
4 class LanguageBe_taraskTest extends LanguageClassesTestCase {
5 // @codingStandardsIgnoreEnd
6 /**
7 * Make sure the language code we are given is indeed
8 * be-tarask. This is to ensure LanguageClassesTestCase
9 * does not give us the wrong language.
11 public function testBeTaraskTestsUsesBeTaraskCode() {
12 $this->assertEquals( 'be-tarask',
13 $this->getLang()->getCode()
17 /**
18 * @see T25156 & r64981
19 * @covers Language::commafy
21 public function testSearchRightSingleQuotationMarkAsApostroph() {
22 $this->assertEquals(
23 "'",
24 $this->getLang()->normalizeForSearch( '’' ),
25 'T25156: U+2019 conversion to U+0027'
29 /**
30 * @see T25156 & r64981
31 * @covers Language::commafy
33 public function testCommafy() {
34 $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
35 $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
38 /**
39 * @see T25156 & r64981
40 * @covers Language::commafy
42 public function testDoesNotCommafyFourDigitsNumber() {
43 $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
46 /**
47 * @dataProvider providePlural
48 * @covers Language::convertPlural
50 public function testPlural( $result, $value ) {
51 $forms = [ 'one', 'few', 'many', 'other' ];
52 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
55 /**
56 * @dataProvider providePlural
57 * @covers Language::getPluralRuleType
59 public function testGetPluralRuleType( $result, $value ) {
60 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
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 ],
79 /**
80 * @dataProvider providePluralTwoForms
81 * @covers Language::convertPlural
83 public function testPluralTwoForms( $result, $value ) {
84 $forms = [ '1=one', 'other' ];
85 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
88 public static function providePluralTwoForms() {
89 return [
90 [ 'other', 0 ],
91 [ 'one', 1 ],
92 [ 'other', 11 ],
93 [ 'other', 91 ],
94 [ 'other', 121 ],