3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
8 /** Tests for MediaWiki languages/classes/LanguagePl.php */
9 class LanguagePlTest
extends LanguageClassesTestCase
{
11 * @dataProvider providePlural
12 * @covers Language::convertPlural
14 public function testPlural( $result, $value ) {
15 $forms = [ 'one', 'few', 'many' ];
16 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
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() {
49 * @dataProvider providePluralTwoForms
50 * @covers Language::convertPlural
52 public function testPluralTwoForms( $result, $value ) {
53 $forms = [ 'one', 'other' ];
54 $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
57 public static function providePluralTwoForms() {
79 * @covers LanguagePl::commafy()
80 * @dataProvider provideCommafyData
82 public function testCommafy( $number, $numbersWithCommas ) {
85 $this->getLang()->commafy( $number ),
90 public static function provideCommafyData() {
91 // Note that commafy() always uses English separators (',' and '.') instead of
92 // Polish (' ' and ','). There is another function that converts them later.
96 [ 1000.0001, '1000.0001' ],
97 [ 10000.0001, '10,000.0001' ],
99 [ -10000, '-10,000' ],
100 [ -1000.0001, '-1000.0001' ],
101 [ -10000.0001, '-10,000.0001' ],