Merge "Fix API output formatting (change lines delimited with * as bold)"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageHeTest.php
index 5ca2bc9..6de88e5 100644 (file)
@@ -15,7 +15,7 @@ class LanguageHeTest extends LanguageClassesTestCase {
        }
 
        function providerPluralDual() {
-               return array (
+               return array(
                        array( 'other', 0 ), // Zero -> plural
                        array( 'one', 1 ), // Singular
                        array( 'two', 2 ), // Dual
@@ -30,11 +30,48 @@ class LanguageHeTest extends LanguageClassesTestCase {
        }
 
        function providerPlural() {
-               return array (
+               return array(
                        array( 'other', 0 ), // Zero -> plural
                        array( 'one', 1 ), // Singular
                        array( 'other', 2 ), // Plural, no dual provided
                        array( 'other', 3 ), // Plural
                );
        }
+
+       /** @dataProvider providerGrammar */
+       function testGrammar( $result, $word, $case ) {
+               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+       }
+
+       // The comments in the beginning of the line help avoid RTL problems
+       // with text editors.
+       function providerGrammar() {
+               return array(
+                       array(
+                               /* result */ 'וויקיפדיה',
+                               /* word   */ 'ויקיפדיה',
+                               /* case   */ 'תחילית',
+                       ),
+                       array(
+                               /* result */ 'וולפגנג',
+                               /* word   */ 'וולפגנג',
+                               /* case   */ 'prefixed',
+                       ),
+                       array(
+                               /* result */ 'קובץ',
+                               /* word   */ 'הקובץ',
+                               /* case   */ 'תחילית',
+                       ),
+                       array(
+                               /* result */ '־Wikipedia',
+                               /* word   */ 'Wikipedia',
+                               /* case   */ 'תחילית',
+                       ),
+                       array(
+                               /* result */ '־1995',
+                               /* word   */ '1995',
+                               /* case   */ 'תחילית',
+                       ),
+               );
+       }
 }