Merge "installer: Run the LESS compiler for *.less files"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageGvTest.php
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2012, Santhosh Thottingal
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/classes/LanguageGv.php */
9 class LanguageGvTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
13 */
14 public function testPlural( $result, $value ) {
15 // This is not compatible with CLDR plural rules http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#gv
16 // What does this mean? Is there a hard-coded override for gv somewhere? -Ryan Kaldari 2013-01-28
17 $forms = array( 'Form 1', 'Form 2', 'Form 3', 'Form 4' );
18 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 }
20
21 /**
22 * @dataProvider providePlural
23 * @covers Language::getPluralRuleType
24 */
25 public function testGetPluralRuleType( $result, $value ) {
26 $this->markTestSkipped( "This test won't work since convertPlural for gv doesn't seem to actually follow our plural rules." );
27 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
28 }
29
30 public static function providePlural() {
31 return array(
32 array( 'Form 4', 0 ),
33 array( 'Form 2', 1 ),
34 array( 'Form 3', 2 ),
35 array( 'Form 4', 3 ),
36 array( 'Form 1', 20 ),
37 array( 'Form 2', 21 ),
38 array( 'Form 3', 22 ),
39 array( 'Form 4', 23 ),
40 array( 'Form 4', 50 ),
41 );
42 }
43 }