Tests: Make phpunit providers "public static".
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageSrTest.php
index c88115d..05e8875 100644 (file)
@@ -16,10 +16,7 @@ require_once dirname( __DIR__ ) . '/bootstrap.php';
 
 /** Tests for MediaWiki languages/LanguageSr.php */
 class LanguageSrTest extends LanguageClassesTestCase {
-
-       ##### TESTS #######################################################
-
-       function testEasyConversions( ) {
+       function testEasyConversions() {
                $this->assertCyrillic(
                        'шђчћжШЂЧЋЖ',
                        'Cyrillic guessing characters'
@@ -113,13 +110,18 @@ class LanguageSrTest extends LanguageClassesTestCase {
                );
        }
 
-       /** @dataProvider providePluralFourForms */
-       function testPluralFourForms( $result, $value ) {
+       /** @dataProvider providePlural */
+       function testPlural( $result, $value ) {
                $forms = array( 'one', 'few', 'many', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       function providePluralFourForms() {
+       /** @dataProvider providePlural */
+       function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePlural() {
                return array (
                        array( 'one', 1 ),
                        array( 'many', 11 ),
@@ -134,17 +136,19 @@ class LanguageSrTest extends LanguageClassesTestCase {
                        array( 'many', 120 ),
                );
        }
+
        /** @dataProvider providePluralTwoForms */
        function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'several' );
+               $forms = array( 'one', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
-       function providePluralTwoForms() {
-               return array (
+
+       public static function providePluralTwoForms() {
+               return array(
                        array( 'one', 1 ),
-                       array( 'several', 11 ),
-                       array( 'several', 91 ),
-                       array( 'several', 121 ),
+                       array( 'other', 11 ),
+                       array( 'other', 91 ),
+                       array( 'other', 121 ),
                );
        }
 
@@ -162,6 +166,7 @@ class LanguageSrTest extends LanguageClassesTestCase {
                        $msg
                );
        }
+
        /**
         * Wrapper to verify a text is different once converted to a variant.
         * @param $text string Text to convert
@@ -185,6 +190,7 @@ class LanguageSrTest extends LanguageClassesTestCase {
                $this->assertUnConverted( $text, 'sr-ec', $msg );
                $this->assertConverted( $text, 'sr-el', $msg );
        }
+
        /**
         * Verifiy the given Latin text is not converted when using
         * using the Latin variant and converted to Cyrillic when using
@@ -201,12 +207,14 @@ class LanguageSrTest extends LanguageClassesTestCase {
                return $this->getLang()
                        ->mConverter
                        ->convertTo(
-                               $text, $variant
-                       );
+                       $text, $variant
+               );
        }
+
        function convertToCyrillic( $text ) {
                return $this->convertTo( $text, 'sr-ec' );
        }
+
        function convertToLatin( $text ) {
                return $this->convertTo( $text, 'sr-el' );
        }