Tests: Make phpunit providers "public static".
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageUkTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * based on LanguageBe_tarask.php
5 * @copyright Copyright © 2012, Amir E. Aharoni
6 * @file
7 */
8
9 /** Tests for MediaWiki languages/classes/LanguageUk.php */
10 class LanguageUkTest extends LanguageClassesTestCase {
11 /** @dataProvider providePlural */
12 function testPlural( $result, $value ) {
13 $forms = array( 'one', 'few', 'many', 'other' );
14 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
15 }
16
17 /** @dataProvider providePlural */
18 function testGetPluralRuleType( $result, $value ) {
19 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
20 }
21
22 public static function providePlural() {
23 return array (
24 array( 'one', 1 ),
25 array( 'many', 11 ),
26 array( 'one', 91 ),
27 array( 'one', 121 ),
28 array( 'few', 2 ),
29 array( 'few', 3 ),
30 array( 'few', 4 ),
31 array( 'few', 334 ),
32 array( 'many', 5 ),
33 array( 'many', 15 ),
34 array( 'many', 120 ),
35 );
36 }
37
38 /** @dataProvider providePluralTwoForms */
39 function testPluralTwoForms( $result, $value ) {
40 $forms = array( 'one', 'other' );
41 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
42 }
43
44 public static function providePluralTwoForms() {
45 return array(
46 array( 'one', 1 ),
47 array( 'other', 11 ),
48 array( 'other', 91 ),
49 array( 'other', 121 ),
50 );
51 }
52 }