fa49a4dddc3dbffdc54a75f893b2546eb0af32be
[lhc/web/wiklou.git] / tests / phpunit / languages / 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 = array( '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 array(
29 array( 'few', 0 ),
30 array( 'one', 1 ),
31 array( 'two', 2 ),
32 array( 'other', 3 ),
33 array( 'few', 10 ),
34 array( 'few', 11 ),
35 array( 'few', 12 ),
36 array( 'few', 19 ),
37 array( 'other', 20 ),
38 array( 'few', 100 ),
39 array( 'one', 101 ),
40 array( 'few', 111 ),
41 array( 'few', 112 ),
42 );
43 }
44
45 /**
46 * @dataProvider providePluralTwoForms
47 * @covers Language::convertPlural
48 */
49 public function testPluralTwoForms( $result, $value ) {
50 $forms = array( 'one', 'other' );
51 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
52 }
53
54 public static function providePluralTwoForms() {
55 return array(
56 array( 'other', 0 ),
57 array( 'one', 1 ),
58 array( 'other', 2 ),
59 array( 'other', 3 ),
60 array( 'other', 10 ),
61 array( 'other', 11 ),
62 array( 'other', 12 ),
63 array( 'other', 19 ),
64 array( 'other', 20 ),
65 array( 'other', 100 ),
66 array( 'one', 101 ),
67 array( 'other', 111 ),
68 array( 'other', 112 ),
69 );
70 }
71 }