MediaWiki  REL1_22
LocalisationCacheTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class LocalisationCacheTest extends MediaWikiTestCase {
00004     public function testPuralRulesFallback() {
00005         $cache = Language::getLocalisationCache();
00006 
00007         $this->assertEquals(
00008             $cache->getItem( 'ar', 'pluralRules' ),
00009             $cache->getItem( 'arz', 'pluralRules' ),
00010             'arz plural rules (undefined) fallback to ar (defined)'
00011         );
00012 
00013         $this->assertEquals(
00014             $cache->getItem( 'ar', 'compiledPluralRules' ),
00015             $cache->getItem( 'arz', 'compiledPluralRules' ),
00016             'arz compiled plural rules (undefined) fallback to ar (defined)'
00017         );
00018 
00019         $this->assertNotEquals(
00020             $cache->getItem( 'ksh', 'pluralRules' ),
00021             $cache->getItem( 'de', 'pluralRules' ),
00022             'ksh plural rules (defined) dont fallback to de (defined)'
00023         );
00024 
00025         $this->assertNotEquals(
00026             $cache->getItem( 'ksh', 'compiledPluralRules' ),
00027             $cache->getItem( 'de', 'compiledPluralRules' ),
00028             'ksh compiled plural rules (defined) dont fallback to de (defined)'
00029         );
00030     }
00031 }