*/
/** 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 ) );
}
/**
* @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',
),
);
}
+
/** @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 ),