MediaWiki  REL1_21
LanguageHeTest.php
Go to the documentation of this file.
00001 <?php
00009 class LanguageHeTest extends LanguageClassesTestCase {
00010 
00012         function testPluralDual( $result, $value ) {
00013                 $forms = array( 'one', 'two', 'other' );
00014                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00015         }
00016 
00017         function providerPluralDual() {
00018                 return array(
00019                         array( 'other', 0 ), // Zero -> plural
00020                         array( 'one', 1 ), // Singular
00021                         array( 'two', 2 ), // Dual
00022                         array( 'other', 3 ), // Plural
00023                 );
00024         }
00025 
00027         function testPlural( $result, $value ) {
00028                 $forms = array( 'one', 'other' );
00029                 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00030         }
00031 
00032         function providerPlural() {
00033                 return array(
00034                         array( 'other', 0 ), // Zero -> plural
00035                         array( 'one', 1 ), // Singular
00036                         array( 'other', 2 ), // Plural, no dual provided
00037                         array( 'other', 3 ), // Plural
00038                 );
00039         }
00040 
00042         function testGrammar( $result, $word, $case ) {
00043                 $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
00044         }
00045 
00046         // The comments in the beginning of the line help avoid RTL problems
00047         // with text editors.
00048         function providerGrammar() {
00049                 return array(
00050                         array(
00051                                 /* result */ 'וויקיפדיה',
00052                                 /* word   */ 'ויקיפדיה',
00053                                 /* case   */ 'תחילית',
00054                         ),
00055                         array(
00056                                 /* result */ 'וולפגנג',
00057                                 /* word   */ 'וולפגנג',
00058                                 /* case   */ 'prefixed',
00059                         ),
00060                         array(
00061                                 /* result */ 'קובץ',
00062                                 /* word   */ 'הקובץ',
00063                                 /* case   */ 'תחילית',
00064                         ),
00065                         array(
00066                                 /* result */ '־Wikipedia',
00067                                 /* word   */ 'Wikipedia',
00068                                 /* case   */ 'תחילית',
00069                         ),
00070                         array(
00071                                 /* result */ '־1995',
00072                                 /* word   */ '1995',
00073                                 /* case   */ 'תחילית',
00074                         ),
00075                 );
00076         }
00077 }