wiki.techinc.nl/tests/phpunit/includes/LocalisationCacheTest.php
addshore 749599fc3c @covers tags for unit tests
Change-Id: I2b486b38326bf23bd379efba2142034e24c0745f
2013-10-24 18:22:57 +01:00

34 lines
956 B
PHP

<?php
/**
* @covers LocalisationCache
*/
class LocalisationCacheTest extends MediaWikiTestCase {
public function testPuralRulesFallback() {
$cache = Language::getLocalisationCache();
$this->assertEquals(
$cache->getItem( 'ar', 'pluralRules' ),
$cache->getItem( 'arz', 'pluralRules' ),
'arz plural rules (undefined) fallback to ar (defined)'
);
$this->assertEquals(
$cache->getItem( 'ar', 'compiledPluralRules' ),
$cache->getItem( 'arz', 'compiledPluralRules' ),
'arz compiled plural rules (undefined) fallback to ar (defined)'
);
$this->assertNotEquals(
$cache->getItem( 'ksh', 'pluralRules' ),
$cache->getItem( 'de', 'pluralRules' ),
'ksh plural rules (defined) dont fallback to de (defined)'
);
$this->assertNotEquals(
$cache->getItem( 'ksh', 'compiledPluralRules' ),
$cache->getItem( 'de', 'compiledPluralRules' ),
'ksh compiled plural rules (defined) dont fallback to de (defined)'
);
}
}