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