test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / languages / LanguageArTest.php
bloba6239120db84a0689294f01217e50a69d5ccd013
1 <?php
2 /**
3 * Based on LanguagMlTest
4 * @file
5 */
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 ) );
14 /**
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() {
23 return array(
24 array(
25 'xg "vs" g',
26 '20120102030410',
27 'يناير vs ٣'
29 array(
30 'xmY',
31 '20120102030410',
32 '١٤٣٣'
34 array(
35 'xnxmY',
36 '20120102030410',
37 '1433'
39 array(
40 'xN xmj xmn xN xmY',
41 '20120102030410',
42 ' 7 2 ١٤٣٣'
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() {
59 return array(
60 array( 'zero', 0 ),
61 array( 'one', 1 ),
62 array( 'two', 2 ),
63 array( 'few', 3 ),
64 array( 'few', 9 ),
65 array( 'few', 110 ),
66 array( 'many', 11 ),
67 array( 'many', 15 ),
68 array( 'many', 99 ),
69 array( 'many', 9999 ),
70 array( 'other', 100 ),
71 array( 'other', 102 ),
72 array( 'other', 1000 ),
73 array( 'other', 1.7 ),