wiki.techinc.nl/tests/phpunit/languages/LanguageHuTest.php
Santhosh Thottingal c1dff7112f For languages without plural forms, use them from fallback language
* Fixes Bug 40251 and this is alternate for I403a29e2
* This brings back the old mediawiki behavior for languages without
  defined plural rules
* Add a test for hu, which had issue as per Bug 40251

Change-Id: I345c305134a62d43c9dfedc5243981d0e77e326d
2012-09-15 12:49:44 -07:00

34 lines
693 B
PHP

<?php
/**
* @author Santhosh Thottingal
* @copyright Copyright © 2012, Santhosh Thottingal
* @file
*/
/** Tests for MediaWiki languages/LanguageHu.php */
class LanguageHuTest extends MediaWikiTestCase {
private $lang;
function setUp() {
$this->lang = Language::factory( 'Hu' );
}
function tearDown() {
unset( $this->lang );
}
/** @dataProvider providePlural */
function testPlural( $result, $value ) {
$forms = array( 'one', 'other' );
$this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
}
function providePlural() {
return array (
array( 'other', 0 ),
array( 'one', 1 ),
array( 'other', 2 ),
array( 'other', 200 ),
);
}
}