3 * Based on LanguagMlTest
7 /** Tests for MediaWiki languages/LanguageAr.php */
8 class LanguageArTest
extends LanguageClassesTestCase
{
9 function testFormatNum() {
10 $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) );
11 $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) );
15 * Mostly to test the raw ascii feature.
16 * @dataProvider providerSprintfDate
18 function testSprintfDate( $format, $date, $expected ) {
19 $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) );
22 public static function providerSprintfDate() {
47 /** @dataProvider providePlural */
48 function testPlural( $result, $value ) {
49 $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
50 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
53 /** @dataProvider providePlural */
54 function testGetPluralRuleType( $result, $value ) {
55 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
58 public static function providePlural() {
69 array( 'many', 9999 ),
70 array( 'other', 100 ),
71 array( 'other', 102 ),
72 array( 'other', 1000 ),
73 array( 'other', 1.7 ),