X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/tests/phpunit/languages/classes/LanguageSeTest.php diff --git a/tests/phpunit/languages/classes/LanguageSeTest.php b/tests/phpunit/languages/classes/LanguageSeTest.php new file mode 100644 index 00000000..b0da3983 --- /dev/null +++ b/tests/phpunit/languages/classes/LanguageSeTest.php @@ -0,0 +1,53 @@ +assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); + } + + /** + * @dataProvider providePlural + * @covers Language::getPluralRuleType + */ + public function testGetPluralRuleType( $result, $value ) { + $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); + } + + public static function providePlural() { + return [ + [ 'other', 0 ], + [ 'one', 1 ], + [ 'two', 2 ], + [ 'other', 3 ], + ]; + } + + /** + * @dataProvider providePluralTwoForms + * @covers Language::convertPlural + */ + public function testPluralTwoForms( $result, $value ) { + $forms = [ 'one', 'other' ]; + $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); + } + + public static function providePluralTwoForms() { + return [ + [ 'other', 0 ], + [ 'one', 1 ], + [ 'other', 2 ], + [ 'other', 3 ], + ]; + } +}