Merge "phpcs: Normalize methods declarations to "[final abstract] [visibility]"."
[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 MediaWiki languages/classes/LanguageSgs.php */
9 class LanguageSgsTest extends LanguageClassesTestCase {
10
11 /** @dataProvider providePluralAllForms */
12 function testPluralAllForms( $result, $value ) {
13 $forms = array( 'one', 'few', 'many', 'other' );
14 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
15 }
16
17 function providePluralAllForms() {
18 return array(
19 array( 'many', 0 ),
20 array( 'one', 1 ),
21 array( 'few', 2 ),
22 array( 'other', 3 ),
23 array( 'many', 10 ),
24 array( 'many', 11 ),
25 array( 'many', 12 ),
26 array( 'many', 19 ),
27 array( 'other', 20 ),
28 array( 'many', 100 ),
29 array( 'one', 101 ),
30 array( 'many', 111 ),
31 array( 'many', 112 ),
32 );
33 }
34
35 /** @dataProvider providePluralTwoForms */
36 function testPluralTwoForms( $result, $value ) {
37 $forms = array( 'one', 'other' );
38 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
39 }
40
41 function providePluralTwoForms() {
42 return array(
43 array( 'other', 0 ),
44 array( 'one', 1 ),
45 array( 'other', 2 ),
46 array( 'other', 3 ),
47 array( 'other', 10 ),
48 array( 'other', 11 ),
49 array( 'other', 12 ),
50 array( 'other', 19 ),
51 array( 'other', 20 ),
52 array( 'other', 100 ),
53 array( 'one', 101 ),
54 array( 'other', 111 ),
55 array( 'other', 112 ),
56 );
57 }
58 }