Add DROP INDEX support to DatabaseSqlite::replaceVars method
[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 /** @dataProvider providePluralAllForms */
11 function testPluralAllForms( $result, $value ) {
12 $forms = array( 'one', 'two', 'few', 'other' );
13 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
14 }
15
16 /** @dataProvider providePluralAllForms */
17 function testGetPluralRuleType( $result, $value ) {
18 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
19 }
20
21 public static function providePluralAllForms() {
22 return array(
23 array( 'few', 0 ),
24 array( 'one', 1 ),
25 array( 'two', 2 ),
26 array( 'other', 3 ),
27 array( 'few', 10 ),
28 array( 'few', 11 ),
29 array( 'few', 12 ),
30 array( 'few', 19 ),
31 array( 'other', 20 ),
32 array( 'few', 100 ),
33 array( 'one', 101 ),
34 array( 'few', 111 ),
35 array( 'few', 112 ),
36 );
37 }
38
39 /** @dataProvider providePluralTwoForms */
40 function testPluralTwoForms( $result, $value ) {
41 $forms = array( 'one', 'other' );
42 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
43 }
44
45 public static function providePluralTwoForms() {
46 return array(
47 array( 'other', 0 ),
48 array( 'one', 1 ),
49 array( 'other', 2 ),
50 array( 'other', 3 ),
51 array( 'other', 10 ),
52 array( 'other', 11 ),
53 array( 'other', 12 ),
54 array( 'other', 19 ),
55 array( 'other', 20 ),
56 array( 'other', 100 ),
57 array( 'one', 101 ),
58 array( 'other', 111 ),
59 array( 'other', 112 ),
60 );
61 }
62 }