Tests: Make phpunit providers "public static".
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageArTest.php
index 84507c5..a623912 100644 (file)
@@ -5,19 +5,10 @@
  */
 
 /** Tests for MediaWiki languages/LanguageAr.php */
-class LanguageArTest extends MediaWikiTestCase {
-       private $lang;
-
-       protected function setUp() {
-               $this->lang = Language::factory( 'Ar' );
-       }
-       protected function tearDown() {
-               unset( $this->lang );
-       }
-
+class LanguageArTest extends LanguageClassesTestCase {
        function testFormatNum() {
-               $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->lang->formatNum( '1234567' ) );
-               $this->assertEquals( '-١٢٫٨٩', $this->lang->formatNum( -12.89 ) );
+               $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) );
+               $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) );
        }
 
        /**
@@ -25,10 +16,10 @@ class LanguageArTest extends MediaWikiTestCase {
         * @dataProvider providerSprintfDate
         */
        function testSprintfDate( $format, $date, $expected ) {
-               $this->assertEquals( $expected, $this->lang->sprintfDate( $format, $date ) );
+               $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) );
        }
 
-       function providerSprintfDate() {
+       public static function providerSprintfDate() {
                return array(
                        array(
                                'xg "vs" g',
@@ -52,13 +43,20 @@ class LanguageArTest extends MediaWikiTestCase {
                        ),
                );
        }
+
        /** @dataProvider providePlural */
        function testPlural( $result, $value ) {
-               $forms =  array( 'zero', 'one', 'two', 'few', 'many', 'other' );
-               $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
+               $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
-       function providePlural() {
-               return array (
+
+       /** @dataProvider providePlural */
+       function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePlural() {
+               return array(
                        array( 'zero', 0 ),
                        array( 'one', 1 ),
                        array( 'two', 2 ),