Allow the retrieval of the plural rule type for a given number
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageBeTest.php
1 <?php
2 /**
3 * @author Santhosh Thottingal
4 * @copyright Copyright © 2012, Santhosh Thottingal
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/LanguageBe.php */
9 class LanguageBeTest extends LanguageClassesTestCase {
10 /** @dataProvider providePlural */
11 function testPlural( $result, $value ) {
12 $forms = array( 'one', 'few', 'many', 'other' );
13 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
14 }
15
16 /** @dataProvider providePlural */
17 function testGetPluralRuleType( $result, $value ) {
18 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
19 }
20
21 function providePlural() {
22 return array(
23 array( 'one', 1 ),
24 array( 'many', 11 ),
25 array( 'one', 91 ),
26 array( 'one', 121 ),
27 array( 'few', 2 ),
28 array( 'few', 3 ),
29 array( 'few', 4 ),
30 array( 'few', 334 ),
31 array( 'many', 5 ),
32 array( 'many', 15 ),
33 array( 'many', 120 ),
34 );
35 }
36 }