Merge "Remove (edit) from Special:Tags for non-editinterface users"
[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 /** @dataProvider providePlural */
11 function testPlural( $result, $value ) {
12 // This is not compatible with CLDR plural rules http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#gv
13 // What does this mean? Is there a hard-coded override for gv somewhere? -Ryan Kaldari 2013-01-28
14 $forms = array( 'Form 1', 'Form 2', 'Form 3', 'Form 4' );
15 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
16 }
17
18 /** @dataProvider providePlural */
19 function testGetPluralRuleType( $result, $value ) {
20 $this->markTestSkipped( "This test won't work since convertPlural for gv doesn't seem to actually follow our plural rules." );
21 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
22 }
23
24 public static function providePlural() {
25 return array (
26 array( 'Form 4', 0 ),
27 array( 'Form 2', 1 ),
28 array( 'Form 3', 2 ),
29 array( 'Form 4', 3 ),
30 array( 'Form 1', 20 ),
31 array( 'Form 2', 21 ),
32 array( 'Form 3', 22 ),
33 array( 'Form 4', 23 ),
34 array( 'Form 4', 50 ),
35 );
36 }
37 }