MediaWiki  REL1_22
LanguageUkTest.php
Go to the documentation of this file.
00001 <?php
00010 class LanguageUkTest extends LanguageClassesTestCase {
00015     public function testPlural( $result, $value ) {
00016         $forms = array( 'one', 'few', 'many', 'other' );
00017         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00018     }
00019 
00024     public function testExplicitPlural() {
00025         $forms = array( 'one', 'few', 'many', 'other', '12=dozen' );
00026         $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
00027         $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' );
00028         $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
00029     }
00030 
00035     public function testGetPluralRuleType( $result, $value ) {
00036         $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
00037     }
00038 
00039     public static function providePlural() {
00040         return array(
00041             array( 'one', 1 ),
00042             array( 'many', 11 ),
00043             array( 'one', 91 ),
00044             array( 'one', 121 ),
00045             array( 'few', 2 ),
00046             array( 'few', 3 ),
00047             array( 'few', 4 ),
00048             array( 'few', 334 ),
00049             array( 'many', 5 ),
00050             array( 'many', 15 ),
00051             array( 'many', 120 ),
00052         );
00053     }
00054 
00059     public function testPluralTwoForms( $result, $value ) {
00060         $forms = array( '1=one', 'other' );
00061         $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
00062     }
00063 
00064     public static function providePluralTwoForms() {
00065         return array(
00066             array( 'one', 1 ),
00067             array( 'other', 11 ),
00068             array( 'other', 91 ),
00069             array( 'other', 121 ),
00070         );
00071     }
00072 }