Merge "Special:Allpages replace table with unordered list"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageGvTest.php
index 71c0160..fc58022 100644 (file)
@@ -1,37 +1,44 @@
 <?php
 /**
+ * Test for Manx (Gaelg) language
+ *
  * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
+ * @copyright Copyright © 2013, Santhosh Thottingal
  * @file
  */
 
-/** Tests for MediaWiki languages/classes/LanguageGv.php */
 class LanguageGvTest extends LanguageClassesTestCase {
-       /** @dataProvider providePlural */
-       function testPlural( $result, $value ) {
-               // This is not compatible with CLDR plural rules http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html#gv
-               // What does this mean? Is there a hard-coded override for gv somewhere? -Ryan Kaldari 2013-01-28
-               $forms = array( 'Form 1', 'Form 2', 'Form 3', 'Form 4' );
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       /** @dataProvider providePlural */
-       function testGetPluralRuleType( $result, $value ) {
-               $this->markTestSkipped( "This test won't work since convertPlural for gv doesn't seem to actually follow our plural rules." );
+       /**
+        * @dataProvider providePlural
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
                $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
        }
 
        public static function providePlural() {
                return array(
-                       array( 'Form 4', 0 ),
-                       array( 'Form 2', 1 ),
-                       array( 'Form 3', 2 ),
-                       array( 'Form 4', 3 ),
-                       array( 'Form 1', 20 ),
-                       array( 'Form 2', 21 ),
-                       array( 'Form 3', 22 ),
-                       array( 'Form 4', 23 ),
-                       array( 'Form 4', 50 ),
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 3 ),
+                       array( 'few', 20 ),
+                       array( 'one', 21 ),
+                       array( 'two', 22 ),
+                       array( 'other', 23 ),
+                       array( 'other', 50 ),
+                       array( 'few', 60 ),
+                       array( 'other', 80 ),
+                       array( 'few', 100 )
                );
        }
 }