Merge "Remove some ancient upgrade information from release notes"
[lhc/web/wiklou.git] / tests / phpunit / languages / classes / LanguageSgsTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
7
8 /** Tests for Samogitian */
9 class LanguageSgsTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePluralAllForms
12 * @covers Language::convertPlural
13 */
14 public function testPluralAllForms( $result, $value ) {
15 $forms = [ 'one', 'two', 'few', 'other' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
17 }
18
19 /**
20 * @dataProvider providePluralAllForms
21 * @covers Language::getPluralRuleType
22 */
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
25 }
26
27 public static function providePluralAllForms() {
28 return [
29 [ 'few', 0 ],
30 [ 'one', 1 ],
31 [ 'two', 2 ],
32 [ 'other', 3 ],
33 [ 'few', 10 ],
34 [ 'few', 11 ],
35 [ 'few', 12 ],
36 [ 'few', 19 ],
37 [ 'other', 20 ],
38 [ 'few', 100 ],
39 [ 'one', 101 ],
40 [ 'few', 111 ],
41 [ 'few', 112 ],
42 ];
43 }
44
45 /**
46 * @dataProvider providePluralTwoForms
47 * @covers Language::convertPlural
48 */
49 public function testPluralTwoForms( $result, $value ) {
50 $forms = [ 'one', 'other' ];
51 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
52 }
53
54 public static function providePluralTwoForms() {
55 return [
56 [ 'other', 0 ],
57 [ 'one', 1 ],
58 [ 'other', 2 ],
59 [ 'other', 3 ],
60 [ 'other', 10 ],
61 [ 'other', 11 ],
62 [ 'other', 12 ],
63 [ 'other', 19 ],
64 [ 'other', 20 ],
65 [ 'other', 100 ],
66 [ 'one', 101 ],
67 [ 'other', 111 ],
68 [ 'other', 112 ],
69 ];
70 }
71 }