Follows-up I9d2b148e57 (including phpunit/languages this time). Bug: 46434 Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
34 lines
899 B
PHP
34 lines
899 B
PHP
<?php
|
|
/**
|
|
* @author Santhosh Thottingal
|
|
* @copyright Copyright © 2012, Santhosh Thottingal
|
|
* @file
|
|
*/
|
|
|
|
/** Tests for MediaWiki languages/classes/LanguageLv.php */
|
|
class LanguageLvTest extends LanguageClassesTestCase {
|
|
/** @dataProvider providePlural */
|
|
function testPlural( $result, $value ) {
|
|
$forms = array( 'zero', 'one', 'other' );
|
|
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
|
|
}
|
|
|
|
/** @dataProvider providePlural */
|
|
function testGetPluralRuleType( $result, $value ) {
|
|
$this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
|
|
}
|
|
|
|
public static function providePlural() {
|
|
return array (
|
|
array( 'zero', 0 ),
|
|
array( 'one', 1 ),
|
|
array( 'other', 11 ),
|
|
array( 'one', 21 ),
|
|
array( 'other', 411 ),
|
|
array( 'other', 12.345 ),
|
|
array( 'other', 20 ),
|
|
array( 'one', 31 ),
|
|
array( 'other', 200 ),
|
|
);
|
|
}
|
|
}
|