Merge "Set default type attribute for button html elements"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageHeTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/classes/LanguageHe.php */
9 class LanguageHeTest extends LanguageClassesTestCase {
10
11 /** @dataProvider providerPluralDual */
12 function testPluralDual( $result, $value ) {
13 $forms = array( 'one', 'two', 'other' );
14 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
15 }
16
17 function providerPluralDual() {
18 return array (
19 array( 'other', 0 ), // Zero -> plural
20 array( 'one', 1 ), // Singular
21 array( 'two', 2 ), // Dual
22 array( 'other', 3 ), // Plural
23 );
24 }
25
26 /** @dataProvider providerPlural */
27 function testPlural( $result, $value ) {
28 $forms = array( 'one', 'other' );
29 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
30 }
31
32 function providerPlural() {
33 return array (
34 array( 'other', 0 ), // Zero -> plural
35 array( 'one', 1 ), // Singular
36 array( 'other', 2 ), // Plural, no dual provided
37 array( 'other', 3 ), // Plural
38 );
39 }
40
41 /** @dataProvider providerGrammar */
42 function testGrammar( $result, $word, $case ) {
43 $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
44 }
45
46 // The comments in the beginning of the line help avoid RTL problems
47 // with text editors.
48 function providerGrammar() {
49 return array (
50 array(
51 /* result */ 'וויקיפדיה',
52 /* word */ 'ויקיפדיה',
53 /* case */ 'תחילית',
54 ),
55 array(
56 /* result */ 'וולפגנג',
57 /* word */ 'וולפגנג',
58 /* case */ 'prefixed',
59 ),
60 array(
61 /* result */ 'קובץ',
62 /* word */ 'הקובץ',
63 /* case */ 'תחילית',
64 ),
65 array(
66 /* result */ '־Wikipedia',
67 /* word */ 'Wikipedia',
68 /* case */ 'תחילית',
69 ),
70 array(
71 /* result */ '־1995',
72 /* word */ '1995',
73 /* case */ 'תחילית',
74 ),
75 );
76 }
77 }