Tests: Make phpunit providers "public static".
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageLtTest.php
index 9d6428b..45f083b 100644 (file)
@@ -7,21 +7,19 @@
 
 /** Tests for MediaWiki languages/LanguageLt.php */
 class LanguageLtTest extends LanguageClassesTestCase {
-
-       /** @dataProvider provideOneFewOtherCases */
-       function testOneFewOtherPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
+       /** @dataProvider providePlural */
+       function testPlural( $result, $value ) {
+               $forms =  array( 'one', 'few', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       /** @dataProvider provideOneFewCases */
-       function testOneFewPlural( $result, $value ) {
-               $forms = array( 'one', 'few' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       /** @dataProvider providePlural */
+       function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
        }
 
-       function provideOneFewOtherCases() {
-               return array(
+       public static function providePlural() {
+               return array (
                        array( 'other', 0 ),
                        array( 'one', 1 ),
                        array( 'few', 2 ),
@@ -36,10 +34,21 @@ class LanguageLtTest extends LanguageClassesTestCase {
                );
        }
 
-       function provideOneFewCases() {
-               return array(
+       /** @dataProvider providePluralTwoForms */
+       function testOneFewPlural( $result, $value ) {
+               $forms =  array( 'one', 'other' );
+               // This fails for 21, but not sure why.
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array (
                        array( 'one', 1 ),
-                       array( 'few', 15 ),
+                       array( 'other', 2 ),
+                       array( 'other', 15 ),
+                       array( 'other', 20 ),
+                       array( 'one', 21 ),
+                       array( 'other', 22 ),
                );
        }
 }