X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Flanguages%2FLanguagePlTest.php;h=d180037bd7222b07aae0c3ff49108948b85a6287;hb=8925e3bd53dc0515c32fc27547df629ac99f0a96;hp=1e36097bc45aa9b3100f837a8ccfc7057be4a1c6;hpb=a37fc7349849de11c68167236d8ad05bb9275bc3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php index 1e36097bc4..d180037bd7 100644 --- a/tests/phpunit/languages/LanguagePlTest.php +++ b/tests/phpunit/languages/LanguagePlTest.php @@ -7,14 +7,24 @@ /** Tests for MediaWiki languages/classes/LanguagePl.php */ class LanguagePlTest extends LanguageClassesTestCase { - - /** @dataProvider providerPluralFourForms */ - function testPluralFourForms( $result, $value ) { + /** + * @dataProvider providePlural + * @covers Language::convertPlural + */ + public function testPlural( $result, $value ) { $forms = array( 'one', 'few', 'many' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPluralFourForms() { + /** + * @dataProvider providePlural + * @covers Language::getPluralRuleType + */ + public function testGetPluralRuleType( $result, $value ) { + $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); + } + + public static function providePlural() { return array( array( 'many', 0 ), array( 'one', 1 ), @@ -35,30 +45,33 @@ class LanguagePlTest extends LanguageClassesTestCase { ); } - /** @dataProvider providerPlural */ - function testPlural( $result, $value ) { - $forms = array( 'one', 'many' ); + /** + * @dataProvider providePluralTwoForms + * @covers Language::convertPlural + */ + public function testPluralTwoForms( $result, $value ) { + $forms = array( 'one', 'other' ); $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } - function providerPlural() { + public static function providePluralTwoForms() { return array( - array( 'many', 0 ), + array( 'other', 0 ), array( 'one', 1 ), - array( 'many', 2 ), - array( 'many', 3 ), - array( 'many', 4 ), - array( 'many', 5 ), - array( 'many', 9 ), - array( 'many', 10 ), - array( 'many', 11 ), - array( 'many', 21 ), - array( 'many', 22 ), - array( 'many', 23 ), - array( 'many', 24 ), - array( 'many', 25 ), - array( 'many', 200 ), - array( 'many', 201 ), + array( 'other', 2 ), + array( 'other', 3 ), + array( 'other', 4 ), + array( 'other', 5 ), + array( 'other', 9 ), + array( 'other', 10 ), + array( 'other', 11 ), + array( 'other', 21 ), + array( 'other', 22 ), + array( 'other', 23 ), + array( 'other', 24 ), + array( 'other', 25 ), + array( 'other', 200 ), + array( 'other', 201 ), ); } }