From d61373ec40636e1ab92263b3503f396318627fab Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Thu, 14 Feb 2013 15:56:13 +0530 Subject: [PATCH] Remove MediaWiki overrides for plural rules for Scots Gaelic (gd) Also cleanup the tests. Change-Id: Ic29026a7a8128b890882b8869569309ab05e4226 --- languages/data/plurals-mediawiki.xml | 15 -------- tests/phpunit/languages/LanguageGdTest.php | 41 +++++++++++++++------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/languages/data/plurals-mediawiki.xml b/languages/data/plurals-mediawiki.xml index 0a380a6c58..14ee09bed6 100644 --- a/languages/data/plurals-mediawiki.xml +++ b/languages/data/plurals-mediawiki.xml @@ -23,21 +23,6 @@ n mod 10 is 2 n mod 10 in 3..4 - - - n is 1 - n is 2 - n is 11 - n is 12 - n in 3..10 or n in 13..19 - n is 1 diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php index 409820faf6..5de1e9d2fe 100644 --- a/tests/phpunit/languages/LanguageGdTest.php +++ b/tests/phpunit/languages/LanguageGdTest.php @@ -1,7 +1,7 @@ assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); } function providerPlural() { - return array( - array( 'Form 6', 0 ), - array( 'Form 1', 1 ), - array( 'Form 2', 2 ), - array( 'Form 3', 11 ), - array( 'Form 4', 12 ), - array( 'Form 5', 3 ), - array( 'Form 5', 19 ), - array( 'Form 6', 200 ), + return array ( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'two', 2 ), + array( 'one', 11 ), + array( 'two', 12 ), + array( 'few', 3 ), + array( 'few', 19 ), + array( 'other', 200 ), ); } + /** @dataProvider providerPluralExplicit */ + function testExplicitPlural( $result, $value ) { + $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' ); + $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) ); + } + + function providerPluralExplicit() { + return array ( + array( 'other', 0 ), + array( 'one', 1 ), + array( 'two', 2 ), + array( 'Form11', 11 ), + array( 'Form12', 12 ), + array( 'few', 3 ), + array( 'few', 19 ), + array( 'other', 200 ), + ); + } } -- 2.20.1