Merge "IcuCollation::$tailoringFirstLetters: 'sv', 'vi' verified"
[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 /** @dataProvider providePlural */
11 function testPlural( $result, $value ) {
12 $forms = array( 'one', 'two', 'other' );
13 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
14 }
15
16 /** @dataProvider providePlural */
17 function testGetPluralRuleType( $result, $value ) {
18 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
19 }
20
21 public static function providePlural() {
22 return array (
23 array( 'other', 0 ),
24 array( 'one', 1 ),
25 array( 'two', 2 ),
26 array( 'other', 3 ),
27 array( 'other', 10 ),
28 );
29 }
30
31 /** @dataProvider provideGrammar */
32 function testGrammar( $result, $word, $case ) {
33 $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
34 }
35
36 // The comments in the beginning of the line help avoid RTL problems
37 // with text editors.
38 public static function provideGrammar() {
39 return array (
40 array(
41 /* result */ 'וויקיפדיה',
42 /* word */ 'ויקיפדיה',
43 /* case */ 'תחילית',
44 ),
45 array(
46 /* result */ 'וולפגנג',
47 /* word */ 'וולפגנג',
48 /* case */ 'prefixed',
49 ),
50 array(
51 /* result */ 'קובץ',
52 /* word */ 'הקובץ',
53 /* case */ 'תחילית',
54 ),
55 array(
56 /* result */ '־Wikipedia',
57 /* word */ 'Wikipedia',
58 /* case */ 'תחילית',
59 ),
60 array(
61 /* result */ '־1995',
62 /* word */ '1995',
63 /* case */ 'תחילית',
64 ),
65 );
66 }
67 }