Merge "Add Special:MediaStatistics page for file type stats"
[mediawiki.git] / tests / phpunit / languages / LanguagePlTest.php
blobd180037bd7222b07aae0c3ff49108948b85a6287
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
8 /** Tests for MediaWiki languages/classes/LanguagePl.php */
9 class LanguagePlTest extends LanguageClassesTestCase {
10 /**
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
14 public function testPlural( $result, $value ) {
15 $forms = array( 'one', 'few', 'many' );
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
19 /**
20 * @dataProvider providePlural
21 * @covers Language::getPluralRuleType
23 public function testGetPluralRuleType( $result, $value ) {
24 $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
27 public static function providePlural() {
28 return array(
29 array( 'many', 0 ),
30 array( 'one', 1 ),
31 array( 'few', 2 ),
32 array( 'few', 3 ),
33 array( 'few', 4 ),
34 array( 'many', 5 ),
35 array( 'many', 9 ),
36 array( 'many', 10 ),
37 array( 'many', 11 ),
38 array( 'many', 21 ),
39 array( 'few', 22 ),
40 array( 'few', 23 ),
41 array( 'few', 24 ),
42 array( 'many', 25 ),
43 array( 'many', 200 ),
44 array( 'many', 201 ),
48 /**
49 * @dataProvider providePluralTwoForms
50 * @covers Language::convertPlural
52 public function testPluralTwoForms( $result, $value ) {
53 $forms = array( 'one', 'other' );
54 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
57 public static function providePluralTwoForms() {
58 return array(
59 array( 'other', 0 ),
60 array( 'one', 1 ),
61 array( 'other', 2 ),
62 array( 'other', 3 ),
63 array( 'other', 4 ),
64 array( 'other', 5 ),
65 array( 'other', 9 ),
66 array( 'other', 10 ),
67 array( 'other', 11 ),
68 array( 'other', 21 ),
69 array( 'other', 22 ),
70 array( 'other', 23 ),
71 array( 'other', 24 ),
72 array( 'other', 25 ),
73 array( 'other', 200 ),
74 array( 'other', 201 ),