Move Test files under same folder structure where class is (/languages/)
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 8 Dec 2014 19:46:23 +0000 (20:46 +0100)
committerLegoktm <legoktm.wikipedia@gmail.com>
Sat, 10 Jan 2015 19:53:59 +0000 (19:53 +0000)
Change-Id: I25c99272a1c2e318e6c61b4a497bf04886430e9b

98 files changed:
tests/phpunit/includes/LanguageConverterTest.php [deleted file]
tests/phpunit/languages/LanguageAmTest.php [deleted file]
tests/phpunit/languages/LanguageArTest.php [deleted file]
tests/phpunit/languages/LanguageArqTest.php [deleted file]
tests/phpunit/languages/LanguageBeTest.php [deleted file]
tests/phpunit/languages/LanguageBe_taraskTest.php [deleted file]
tests/phpunit/languages/LanguageBhoTest.php [deleted file]
tests/phpunit/languages/LanguageBsTest.php [deleted file]
tests/phpunit/languages/LanguageConverterTest.php [new file with mode: 0644]
tests/phpunit/languages/LanguageCsTest.php [deleted file]
tests/phpunit/languages/LanguageCuTest.php [deleted file]
tests/phpunit/languages/LanguageCyTest.php [deleted file]
tests/phpunit/languages/LanguageDsbTest.php [deleted file]
tests/phpunit/languages/LanguageFrTest.php [deleted file]
tests/phpunit/languages/LanguageGaTest.php [deleted file]
tests/phpunit/languages/LanguageGdTest.php [deleted file]
tests/phpunit/languages/LanguageGvTest.php [deleted file]
tests/phpunit/languages/LanguageHeTest.php [deleted file]
tests/phpunit/languages/LanguageHiTest.php [deleted file]
tests/phpunit/languages/LanguageHrTest.php [deleted file]
tests/phpunit/languages/LanguageHsbTest.php [deleted file]
tests/phpunit/languages/LanguageHuTest.php [deleted file]
tests/phpunit/languages/LanguageHyTest.php [deleted file]
tests/phpunit/languages/LanguageKshTest.php [deleted file]
tests/phpunit/languages/LanguageLnTest.php [deleted file]
tests/phpunit/languages/LanguageLtTest.php [deleted file]
tests/phpunit/languages/LanguageLvTest.php [deleted file]
tests/phpunit/languages/LanguageMgTest.php [deleted file]
tests/phpunit/languages/LanguageMkTest.php [deleted file]
tests/phpunit/languages/LanguageMlTest.php [deleted file]
tests/phpunit/languages/LanguageMoTest.php [deleted file]
tests/phpunit/languages/LanguageMtTest.php [deleted file]
tests/phpunit/languages/LanguageNlTest.php [deleted file]
tests/phpunit/languages/LanguageNsoTest.php [deleted file]
tests/phpunit/languages/LanguagePlTest.php [deleted file]
tests/phpunit/languages/LanguageRoTest.php [deleted file]
tests/phpunit/languages/LanguageRuTest.php [deleted file]
tests/phpunit/languages/LanguageSeTest.php [deleted file]
tests/phpunit/languages/LanguageSgsTest.php [deleted file]
tests/phpunit/languages/LanguageShTest.php [deleted file]
tests/phpunit/languages/LanguageSkTest.php [deleted file]
tests/phpunit/languages/LanguageSlTest.php [deleted file]
tests/phpunit/languages/LanguageSmaTest.php [deleted file]
tests/phpunit/languages/LanguageSrTest.php [deleted file]
tests/phpunit/languages/LanguageTiTest.php [deleted file]
tests/phpunit/languages/LanguageTlTest.php [deleted file]
tests/phpunit/languages/LanguageTrTest.php [deleted file]
tests/phpunit/languages/LanguageUkTest.php [deleted file]
tests/phpunit/languages/LanguageUzTest.php [deleted file]
tests/phpunit/languages/LanguageWaTest.php [deleted file]
tests/phpunit/languages/classes/LanguageAmTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageArTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageArqTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageBeTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageBe_taraskTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageBhoTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageBsTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageCsTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageCuTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageCyTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageDsbTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageFrTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageGaTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageGdTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageGvTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHeTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHiTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHrTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHsbTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHuTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageHyTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageKshTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageLnTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageLtTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageLvTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageMgTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageMkTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageMlTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageMoTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageMtTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageNlTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageNsoTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguagePlTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageRoTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageRuTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSeTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSgsTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageShTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSkTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSlTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSmaTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageSrTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageTiTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageTlTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageTrTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageUkTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageUzTest.php [new file with mode: 0644]
tests/phpunit/languages/classes/LanguageWaTest.php [new file with mode: 0644]

diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/includes/LanguageConverterTest.php
deleted file mode 100644 (file)
index d4ccca9..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-<?php
-
-class LanguageConverterTest extends MediaWikiLangTestCase {
-       /** @var LanguageToTest */
-       protected $lang = null;
-       /** @var TestConverter */
-       protected $lc = null;
-
-       protected function setUp() {
-               parent::setUp();
-
-               $this->setMwGlobals( array(
-                       'wgContLang' => Language::factory( 'tg' ),
-                       'wgLanguageCode' => 'tg',
-                       'wgDefaultLanguageVariant' => false,
-                       'wgMemc' => new EmptyBagOStuff,
-                       'wgRequest' => new FauxRequest( array() ),
-                       'wgUser' => new User,
-               ) );
-
-               $this->lang = new LanguageToTest();
-               $this->lc = new TestConverter(
-                       $this->lang, 'tg',
-                       array( 'tg', 'tg-latn' )
-               );
-       }
-
-       protected function tearDown() {
-               unset( $this->lc );
-               unset( $this->lang );
-
-               parent::tearDown();
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        */
-       public function testGetPreferredVariantDefaults() {
-               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getHeaderVariant
-        */
-       public function testGetPreferredVariantHeaders() {
-               global $wgRequest;
-               $wgRequest->setHeader( 'Accept-Language', 'tg-latn' );
-
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getHeaderVariant
-        */
-       public function testGetPreferredVariantHeaderWeight() {
-               global $wgRequest;
-               $wgRequest->setHeader( 'Accept-Language', 'tg;q=1' );
-
-               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getHeaderVariant
-        */
-       public function testGetPreferredVariantHeaderWeight2() {
-               global $wgRequest;
-               $wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' );
-
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getHeaderVariant
-        */
-       public function testGetPreferredVariantHeaderMulti() {
-               global $wgRequest;
-               $wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' );
-
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        */
-       public function testGetPreferredVariantUserOption() {
-               global $wgUser;
-
-               $wgUser = new User;
-               $wgUser->load(); // from 'defaults'
-               $wgUser->mId = 1;
-               $wgUser->mDataLoaded = true;
-               $wgUser->mOptionsLoaded = true;
-               $wgUser->setOption( 'variant', 'tg-latn' );
-
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getUserVariant
-        */
-       public function testGetPreferredVariantUserOptionForForeignLanguage() {
-               global $wgContLang, $wgUser;
-
-               $wgContLang = Language::factory( 'en' );
-               $wgUser = new User;
-               $wgUser->load(); // from 'defaults'
-               $wgUser->mId = 1;
-               $wgUser->mDataLoaded = true;
-               $wgUser->mOptionsLoaded = true;
-               $wgUser->setOption( 'variant-tg', 'tg-latn' );
-
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getUserVariant
-        * @covers LanguageConverter::getURLVariant
-        */
-       public function testGetPreferredVariantHeaderUserVsUrl() {
-               global $wgContLang, $wgRequest, $wgUser;
-
-               $wgContLang = Language::factory( 'tg-latn' );
-               $wgRequest->setVal( 'variant', 'tg' );
-               $wgUser = User::newFromId( "admin" );
-               $wgUser->setId( 1 );
-               $wgUser->mFrom = 'defaults';
-               $wgUser->mOptionsLoaded = true;
-               // The user's data is ignored because the variant is set in the URL.
-               $wgUser->setOption( 'variant', 'tg-latn' );
-               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        */
-       public function testGetPreferredVariantDefaultLanguageVariant() {
-               global $wgDefaultLanguageVariant;
-
-               $wgDefaultLanguageVariant = 'tg-latn';
-               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
-       }
-
-       /**
-        * @covers LanguageConverter::getPreferredVariant
-        * @covers LanguageConverter::getURLVariant
-        */
-       public function testGetPreferredVariantDefaultLanguageVsUrlVariant() {
-               global $wgDefaultLanguageVariant, $wgRequest, $wgContLang;
-
-               $wgContLang = Language::factory( 'tg-latn' );
-               $wgDefaultLanguageVariant = 'tg';
-               $wgRequest->setVal( 'variant', null );
-               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
-       }
-}
-
-/**
- * Test converter (from Tajiki to latin orthography)
- */
-class TestConverter extends LanguageConverter {
-       private $table = array(
-               'б' => 'b',
-               'в' => 'v',
-               'г' => 'g',
-       );
-
-       function loadDefaultTables() {
-               $this->mTables = array(
-                       'tg-latn' => new ReplacementArray( $this->table ),
-                       'tg' => new ReplacementArray()
-               );
-       }
-}
-
-class LanguageToTest extends Language {
-       function __construct() {
-               parent::__construct();
-               $variants = array( 'tg', 'tg-latn' );
-               $this->mConverter = new TestConverter( $this, 'tg', $variants );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageAmTest.php b/tests/phpunit/languages/LanguageAmTest.php
deleted file mode 100644 (file)
index a644f5e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageAm.php */
-class LanguageAmTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageArTest.php b/tests/phpunit/languages/LanguageArTest.php
deleted file mode 100644 (file)
index 7b48f23..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/**
- * Based on LanguagMlTest
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageAr.php */
-class LanguageArTest extends LanguageClassesTestCase {
-       /**
-        * @covers Language::formatNum
-        * @todo split into a test and a dataprovider
-        */
-       public function testFormatNum() {
-               $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) );
-               $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) );
-       }
-
-       /**
-        * Mostly to test the raw ascii feature.
-        * @dataProvider providerSprintfDate
-        * @covers Language::sprintfDate
-        */
-       public function testSprintfDate( $format, $date, $expected ) {
-               $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) );
-       }
-
-       public static function providerSprintfDate() {
-               return array(
-                       array(
-                               'xg "vs" g',
-                               '20120102030410',
-                               'يناير vs ٣'
-                       ),
-                       array(
-                               'xmY',
-                               '20120102030410',
-                               '١٤٣٣'
-                       ),
-                       array(
-                               'xnxmY',
-                               '20120102030410',
-                               '1433'
-                       ),
-                       array(
-                               'xN xmj xmn xN xmY',
-                               '20120102030410',
-                               ' 7 2  ١٤٣٣'
-                       ),
-               );
-       }
-
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
-               $this->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 array(
-                       array( 'zero', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 9 ),
-                       array( 'few', 110 ),
-                       array( 'many', 11 ),
-                       array( 'many', 15 ),
-                       array( 'many', 99 ),
-                       array( 'many', 9999 ),
-                       array( 'other', 100 ),
-                       array( 'other', 102 ),
-                       array( 'other', 1000 ),
-                       array( 'other', 1.7 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageArqTest.php b/tests/phpunit/languages/LanguageArqTest.php
deleted file mode 100644 (file)
index 3fa56d7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Based on LanguageMlTest
- * @author Joel Sahleen
- * @copyright Copyright © 2014, Joel Sahleen
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageArq.php */
-class LanguageArqTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider provideNumber
-        * @covers Language::formatNum
-        */
-       public function testFormatNum( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
-       }
-
-       public static function provideNumber() {
-               return array(
-                       array( '1.234.567', '1234567'),
-                       array( '-12,89', -12.89 ),
-                       );
-       }
-
-}
diff --git a/tests/phpunit/languages/LanguageBeTest.php b/tests/phpunit/languages/LanguageBeTest.php
deleted file mode 100644 (file)
index 7bd586a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageBe.php */
-class LanguageBeTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many', 'other' );
-               $this->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 array(
-                       array( 'one', 1 ),
-                       array( 'many', 11 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'few', 334 ),
-                       array( 'many', 5 ),
-                       array( 'many', 15 ),
-                       array( 'many', 120 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/LanguageBe_taraskTest.php
deleted file mode 100644 (file)
index 4dd5cdd..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-// @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps
-class LanguageBe_taraskTest extends LanguageClassesTestCase {
-       // @codingStandardsIgnoreEnd
-       /**
-        * Make sure the language code we are given is indeed
-        * be-tarask. This is to ensure LanguageClassesTestCase
-        * does not give us the wrong language.
-        */
-       public function testBeTaraskTestsUsesBeTaraskCode() {
-               $this->assertEquals( 'be-tarask',
-                       $this->getLang()->getCode()
-               );
-       }
-
-       /**
-        * @see bug 23156 & r64981
-        * @covers Language::commafy
-        */
-       public function testSearchRightSingleQuotationMarkAsApostroph() {
-               $this->assertEquals(
-                       "'",
-                       $this->getLang()->normalizeForSearch( '’' ),
-                       'bug 23156: U+2019 conversion to U+0027'
-               );
-       }
-
-       /**
-        * @see bug 23156 & r64981
-        * @covers Language::commafy
-        */
-       public function testCommafy() {
-               $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
-               $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
-       }
-
-       /**
-        * @see bug 23156 & r64981
-        * @covers Language::commafy
-        */
-       public function testDoesNotCommafyFourDigitsNumber() {
-               $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
-       }
-
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many', 'other' );
-               $this->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 array(
-                       array( 'one', 1 ),
-                       array( 'many', 11 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'few', 334 ),
-                       array( 'many', 5 ),
-                       array( 'many', 15 ),
-                       array( 'many', 120 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( '1=one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 11 ),
-                       array( 'other', 91 ),
-                       array( 'other', 121 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageBhoTest.php b/tests/phpunit/languages/LanguageBhoTest.php
deleted file mode 100644 (file)
index 187bfbb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageBho.php */
-class LanguageBhoTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageBsTest.php b/tests/phpunit/languages/LanguageBsTest.php
deleted file mode 100644 (file)
index 7aca2ab..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for Croatian (hrvatski) */
-class LanguageBsTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'one', 21 ),
-                       array( 'few', 24 ),
-                       array( 'other', 25 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageConverterTest.php b/tests/phpunit/languages/LanguageConverterTest.php
new file mode 100644 (file)
index 0000000..d4ccca9
--- /dev/null
@@ -0,0 +1,187 @@
+<?php
+
+class LanguageConverterTest extends MediaWikiLangTestCase {
+       /** @var LanguageToTest */
+       protected $lang = null;
+       /** @var TestConverter */
+       protected $lc = null;
+
+       protected function setUp() {
+               parent::setUp();
+
+               $this->setMwGlobals( array(
+                       'wgContLang' => Language::factory( 'tg' ),
+                       'wgLanguageCode' => 'tg',
+                       'wgDefaultLanguageVariant' => false,
+                       'wgMemc' => new EmptyBagOStuff,
+                       'wgRequest' => new FauxRequest( array() ),
+                       'wgUser' => new User,
+               ) );
+
+               $this->lang = new LanguageToTest();
+               $this->lc = new TestConverter(
+                       $this->lang, 'tg',
+                       array( 'tg', 'tg-latn' )
+               );
+       }
+
+       protected function tearDown() {
+               unset( $this->lc );
+               unset( $this->lang );
+
+               parent::tearDown();
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        */
+       public function testGetPreferredVariantDefaults() {
+               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getHeaderVariant
+        */
+       public function testGetPreferredVariantHeaders() {
+               global $wgRequest;
+               $wgRequest->setHeader( 'Accept-Language', 'tg-latn' );
+
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getHeaderVariant
+        */
+       public function testGetPreferredVariantHeaderWeight() {
+               global $wgRequest;
+               $wgRequest->setHeader( 'Accept-Language', 'tg;q=1' );
+
+               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getHeaderVariant
+        */
+       public function testGetPreferredVariantHeaderWeight2() {
+               global $wgRequest;
+               $wgRequest->setHeader( 'Accept-Language', 'tg-latn;q=1' );
+
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getHeaderVariant
+        */
+       public function testGetPreferredVariantHeaderMulti() {
+               global $wgRequest;
+               $wgRequest->setHeader( 'Accept-Language', 'en, tg-latn;q=1' );
+
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        */
+       public function testGetPreferredVariantUserOption() {
+               global $wgUser;
+
+               $wgUser = new User;
+               $wgUser->load(); // from 'defaults'
+               $wgUser->mId = 1;
+               $wgUser->mDataLoaded = true;
+               $wgUser->mOptionsLoaded = true;
+               $wgUser->setOption( 'variant', 'tg-latn' );
+
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getUserVariant
+        */
+       public function testGetPreferredVariantUserOptionForForeignLanguage() {
+               global $wgContLang, $wgUser;
+
+               $wgContLang = Language::factory( 'en' );
+               $wgUser = new User;
+               $wgUser->load(); // from 'defaults'
+               $wgUser->mId = 1;
+               $wgUser->mDataLoaded = true;
+               $wgUser->mOptionsLoaded = true;
+               $wgUser->setOption( 'variant-tg', 'tg-latn' );
+
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getUserVariant
+        * @covers LanguageConverter::getURLVariant
+        */
+       public function testGetPreferredVariantHeaderUserVsUrl() {
+               global $wgContLang, $wgRequest, $wgUser;
+
+               $wgContLang = Language::factory( 'tg-latn' );
+               $wgRequest->setVal( 'variant', 'tg' );
+               $wgUser = User::newFromId( "admin" );
+               $wgUser->setId( 1 );
+               $wgUser->mFrom = 'defaults';
+               $wgUser->mOptionsLoaded = true;
+               // The user's data is ignored because the variant is set in the URL.
+               $wgUser->setOption( 'variant', 'tg-latn' );
+               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        */
+       public function testGetPreferredVariantDefaultLanguageVariant() {
+               global $wgDefaultLanguageVariant;
+
+               $wgDefaultLanguageVariant = 'tg-latn';
+               $this->assertEquals( 'tg-latn', $this->lc->getPreferredVariant() );
+       }
+
+       /**
+        * @covers LanguageConverter::getPreferredVariant
+        * @covers LanguageConverter::getURLVariant
+        */
+       public function testGetPreferredVariantDefaultLanguageVsUrlVariant() {
+               global $wgDefaultLanguageVariant, $wgRequest, $wgContLang;
+
+               $wgContLang = Language::factory( 'tg-latn' );
+               $wgDefaultLanguageVariant = 'tg';
+               $wgRequest->setVal( 'variant', null );
+               $this->assertEquals( 'tg', $this->lc->getPreferredVariant() );
+       }
+}
+
+/**
+ * Test converter (from Tajiki to latin orthography)
+ */
+class TestConverter extends LanguageConverter {
+       private $table = array(
+               'б' => 'b',
+               'в' => 'v',
+               'г' => 'g',
+       );
+
+       function loadDefaultTables() {
+               $this->mTables = array(
+                       'tg-latn' => new ReplacementArray( $this->table ),
+                       'tg' => new ReplacementArray()
+               );
+       }
+}
+
+class LanguageToTest extends Language {
+       function __construct() {
+               parent::__construct();
+               $variants = array( 'tg', 'tg-latn' );
+               $this->mConverter = new TestConverter( $this, 'tg', $variants );
+       }
+}
diff --git a/tests/phpunit/languages/LanguageCsTest.php b/tests/phpunit/languages/LanguageCsTest.php
deleted file mode 100644 (file)
index da9e6b8..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/Languagecs.php */
-class LanguageCsTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'other', 25 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageCuTest.php b/tests/phpunit/languages/LanguageCuTest.php
deleted file mode 100644 (file)
index 0719317..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageCu.php */
-class LanguageCuTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'one', 11 ),
-                       array( 'other', 20 ),
-                       array( 'two', 22 ),
-                       array( 'few', 223 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageCyTest.php b/tests/phpunit/languages/LanguageCyTest.php
deleted file mode 100644 (file)
index eaf663a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageCy.php */
-class LanguageCyTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
-               $this->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 array(
-                       array( 'zero', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'many', 6 ),
-                       array( 'other', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'other', 22 ),
-                       array( 'other', 223 ),
-                       array( 'other', 200.00 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageDsbTest.php b/tests/phpunit/languages/LanguageDsbTest.php
deleted file mode 100644 (file)
index 94c11bc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageDsb.php */
-class LanguageDsbTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'one', 101 ),
-                       array( 'one', 90001 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 203 ),
-                       array( 'few', 4 ),
-                       array( 'other', 99 ),
-                       array( 'other', 555 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageFrTest.php b/tests/phpunit/languages/LanguageFrTest.php
deleted file mode 100644 (file)
index 46b6501..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageFr.php */
-class LanguageFrTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageGaTest.php b/tests/phpunit/languages/LanguageGaTest.php
deleted file mode 100644 (file)
index c009f56..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageGa.php */
-class LanguageGaTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageGdTest.php b/tests/phpunit/languages/LanguageGdTest.php
deleted file mode 100644 (file)
index b89b4df..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012-2013, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageGd.php */
-class LanguageGdTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providerPlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providerPlural() {
-               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
-        * @covers Language::convertPlural
-        */
-       public function testExplicitPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static 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 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageGvTest.php b/tests/phpunit/languages/LanguageGvTest.php
deleted file mode 100644 (file)
index e6a0cf0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
- * Test for Manx (Gaelg) language
- *
- * @author Santhosh Thottingal
- * @copyright Copyright © 2013, Santhosh Thottingal
- * @file
- */
-
-class LanguageGvTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->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 array(
-                       array( 'few', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'other', 3 ),
-                       array( 'few', 20 ),
-                       array( 'one', 21 ),
-                       array( 'two', 22 ),
-                       array( 'other', 23 ),
-                       array( 'other', 50 ),
-                       array( 'few', 60 ),
-                       array( 'few', 80 ),
-                       array( 'few', 100 )
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHeTest.php b/tests/phpunit/languages/LanguageHeTest.php
deleted file mode 100644 (file)
index c382244..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageHe.php */
-class LanguageHeTest extends LanguageClassesTestCase {
-       /**
-        * The most common usage for the plural forms is two forms,
-        * for singular and plural. In this case, the second form
-        * is technically dual, but in practice it's used as plural.
-        * In some cases, usually with expressions of time, three forms
-        * are needed - singular, dual and plural.
-        * CLDR also specifies a fourth form for multiples of 10,
-        * which is very rare. It also has a mistake, because
-        * the number 10 itself is supposed to be just plural,
-        * so currently it's overridden in MediaWiki.
-        */
-
-       // @todo the below test*PluralForms test methods can be refactored
-       //  to use a single test method and data provider..
-
-       /**
-        * @dataProvider provideTwoPluralForms
-        * @covers Language::convertPlural
-        */
-       public function testTwoPluralForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * @dataProvider provideThreePluralForms
-        * @covers Language::convertPlural
-        */
-       public function testThreePluralForms( $result, $value ) {
-               $forms = array( 'one', 'two', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * @dataProvider provideFourPluralForms
-        * @covers Language::convertPlural
-        */
-       public function testFourPluralForms( $result, $value ) {
-               $forms = array( 'one', 'two', 'many', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * @dataProvider provideFourPluralForms
-        * @covers Language::convertPlural
-        */
-       public function testGetPluralRuleType( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
-       }
-
-       public static function provideTwoPluralForms() {
-               return array(
-                       array( 'other', 0 ), // Zero - plural
-                       array( 'one', 1 ), // Singular
-                       array( 'other', 2 ), // No third form provided, use it as plural
-                       array( 'other', 3 ), // Plural - other
-                       array( 'other', 10 ), // No fourth form provided, use it as plural
-                       array( 'other', 20 ), // No fourth form provided, use it as plural
-               );
-       }
-
-       public static function provideThreePluralForms() {
-               return array(
-                       array( 'other', 0 ), // Zero - plural
-                       array( 'one', 1 ), // Singular
-                       array( 'two', 2 ), // Dual
-                       array( 'other', 3 ), // Plural - other
-                       array( 'other', 10 ), // No fourth form provided, use it as plural
-                       array( 'other', 20 ), // No fourth form provided, use it as plural
-               );
-       }
-
-       public static function provideFourPluralForms() {
-               return array(
-                       array( 'other', 0 ), // Zero - plural
-                       array( 'one', 1 ), // Singular
-                       array( 'two', 2 ), // Dual
-                       array( 'other', 3 ), // Plural - other
-                       array( 'other', 10 ), // 10 is supposed to be plural (other), not "many"
-                       array( 'many', 20 ), // Fourth form provided - rare, but supported by CLDR
-               );
-       }
-
-       /**
-        * @dataProvider provideGrammar
-        * @covers Language::convertGrammar
-        */
-       public function testGrammar( $result, $word, $case ) {
-               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
-       }
-
-       // The comments in the beginning of the line help avoid RTL problems
-       // with text editors.
-       public static function provideGrammar() {
-               return array(
-                       array(
-                               /* result */'וויקיפדיה',
-                               /* word   */'ויקיפדיה',
-                               /* case   */'תחילית',
-                       ),
-                       array(
-                               /* result */'וולפגנג',
-                               /* word   */'וולפגנג',
-                               /* case   */'prefixed',
-                       ),
-                       array(
-                               /* result */'קובץ',
-                               /* word   */'הקובץ',
-                               /* case   */'תחילית',
-                       ),
-                       array(
-                               /* result */'־Wikipedia',
-                               /* word   */'Wikipedia',
-                               /* case   */'תחילית',
-                       ),
-                       array(
-                               /* result */'־1995',
-                               /* word   */'1995',
-                               /* case   */'תחילית',
-                       ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHiTest.php b/tests/phpunit/languages/LanguageHiTest.php
deleted file mode 100644 (file)
index f6d2c9e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageHi.php */
-class LanguageHiTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHrTest.php b/tests/phpunit/languages/LanguageHrTest.php
deleted file mode 100644 (file)
index 644c525..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageHr.php */
-class LanguageHrTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'one', 21 ),
-                       array( 'few', 24 ),
-                       array( 'other', 25 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHsbTest.php b/tests/phpunit/languages/LanguageHsbTest.php
deleted file mode 100644 (file)
index f95a43b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageHsb.php */
-class LanguageHsbTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'one', 101 ),
-                       array( 'one', 90001 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 203 ),
-                       array( 'few', 4 ),
-                       array( 'other', 99 ),
-                       array( 'other', 555 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHuTest.php b/tests/phpunit/languages/LanguageHuTest.php
deleted file mode 100644 (file)
index ee9197d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageHu.php */
-class LanguageHuTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageHyTest.php b/tests/phpunit/languages/LanguageHyTest.php
deleted file mode 100644 (file)
index 92e0ef9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for Armenian (Հայերեն) */
-class LanguageHyTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageKshTest.php b/tests/phpunit/languages/LanguageKshTest.php
deleted file mode 100644 (file)
index 568a378..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageKsh.php */
-class LanguageKshTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other', 'zero' );
-               $this->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 array(
-                       array( 'zero', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageLnTest.php b/tests/phpunit/languages/LanguageLnTest.php
deleted file mode 100644 (file)
index 10b3234..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageLn.php */
-class LanguageLnTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageLtTest.php b/tests/phpunit/languages/LanguageLtTest.php
deleted file mode 100644 (file)
index 30642f6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageLt.php */
-class LanguageLtTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 9 ),
-                       array( 'other', 10 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'one', 21 ),
-                       array( 'few', 32 ),
-                       array( 'one', 41 ),
-                       array( 'one', 40001 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testOneFewPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               // This fails for 21, but not sure why.
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 15 ),
-                       array( 'other', 20 ),
-                       array( 'one', 21 ),
-                       array( 'other', 22 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageLvTest.php b/tests/phpunit/languages/LanguageLvTest.php
deleted file mode 100644 (file)
index 7120cfe..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for Latvian */
-class LanguageLvTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'zero', 'one', 'other' );
-               $this->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 array(
-                       array( 'zero', 0 ),
-                       array( 'one', 1 ),
-                       array( 'zero', 11 ),
-                       array( 'one', 21 ),
-                       array( 'zero', 411 ),
-                       array( 'other', 2 ),
-                       array( 'other', 9 ),
-                       array( 'zero', 12 ),
-                       array( 'other', 12.345 ),
-                       array( 'zero', 20 ),
-                       array( 'other', 22 ),
-                       array( 'one', 31 ),
-                       array( 'zero', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageMgTest.php b/tests/phpunit/languages/LanguageMgTest.php
deleted file mode 100644 (file)
index 65e8fd7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageMg.php */
-class LanguageMgTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 200 ),
-                       array( 'other', 123.3434 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageMkTest.php b/tests/phpunit/languages/LanguageMkTest.php
deleted file mode 100644 (file)
index ed15526..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for македонски/Macedonian */
-class LanguageMkTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'one', 11 ),
-                       array( 'one', 21 ),
-                       array( 'one', 411 ),
-                       array( 'other', 12.345 ),
-                       array( 'other', 20 ),
-                       array( 'one', 31 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageMlTest.php b/tests/phpunit/languages/LanguageMlTest.php
deleted file mode 100644 (file)
index 4fa45ce..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2011, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageMl.php */
-class LanguageMlTest extends LanguageClassesTestCase {
-
-       /**
-        * @dataProvider providerFormatNum
-        * @see bug 29495
-        * @covers Language::formatNum
-        */
-       public function testFormatNum( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
-       }
-
-       public static function providerFormatNum() {
-               return array(
-                       array( '12,34,567', '1234567' ),
-                       array( '12,345', '12345' ),
-                       array( '1', '1' ),
-                       array( '123', '123' ),
-                       array( '1,234', '1234' ),
-                       array( '12,345.56', '12345.56' ),
-                       array( '12,34,56,79,81,23,45,678', '12345679812345678' ),
-                       array( '.12345', '.12345' ),
-                       array( '-12,00,000', '-1200000' ),
-                       array( '-98', '-98' ),
-                       array( '-98', -98 ),
-                       array( '-1,23,45,678', -12345678 ),
-                       array( '', '' ),
-                       array( '', null ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php
deleted file mode 100644 (file)
index e0e54ca..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageMo.php */
-class LanguageMoTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'few', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 19 ),
-                       array( 'other', 20 ),
-                       array( 'other', 99 ),
-                       array( 'other', 100 ),
-                       array( 'few', 101 ),
-                       array( 'few', 119 ),
-                       array( 'other', 120 ),
-                       array( 'other', 200 ),
-                       array( 'few', 201 ),
-                       array( 'few', 219 ),
-                       array( 'other', 220 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageMtTest.php b/tests/phpunit/languages/LanguageMtTest.php
deleted file mode 100644 (file)
index 96d2bc9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageMt.php */
-class LanguageMtTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many', 'other' );
-               $this->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 array(
-                       array( 'few', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 10 ),
-                       array( 'many', 11 ),
-                       array( 'many', 19 ),
-                       array( 'other', 20 ),
-                       array( 'other', 99 ),
-                       array( 'other', 100 ),
-                       array( 'other', 101 ),
-                       array( 'few', 102 ),
-                       array( 'few', 110 ),
-                       array( 'many', 111 ),
-                       array( 'many', 119 ),
-                       array( 'other', 120 ),
-                       array( 'other', 201 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 10 ),
-                       array( 'other', 11 ),
-                       array( 'other', 19 ),
-                       array( 'other', 20 ),
-                       array( 'other', 99 ),
-                       array( 'other', 100 ),
-                       array( 'other', 101 ),
-                       array( 'other', 102 ),
-                       array( 'other', 110 ),
-                       array( 'other', 111 ),
-                       array( 'other', 119 ),
-                       array( 'other', 120 ),
-                       array( 'other', 201 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageNlTest.php b/tests/phpunit/languages/LanguageNlTest.php
deleted file mode 100644 (file)
index 26bd691..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2011, Santhosh Thottingal
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageNl.php */
-class LanguageNlTest extends LanguageClassesTestCase {
-
-       /**
-        * @covers Language::formatNum
-        * @todo split into a test and a dataprovider
-        */
-       public function testFormatNum() {
-               $this->assertEquals( '1.234.567', $this->getLang()->formatNum( '1234567' ) );
-               $this->assertEquals( '12.345', $this->getLang()->formatNum( '12345' ) );
-               $this->assertEquals( '1', $this->getLang()->formatNum( '1' ) );
-               $this->assertEquals( '123', $this->getLang()->formatNum( '123' ) );
-               $this->assertEquals( '1.234', $this->getLang()->formatNum( '1234' ) );
-               $this->assertEquals( '12.345,56', $this->getLang()->formatNum( '12345.56' ) );
-               $this->assertEquals( ',1234556', $this->getLang()->formatNum( '.1234556' ) );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageNsoTest.php b/tests/phpunit/languages/LanguageNsoTest.php
deleted file mode 100644 (file)
index 18efd73..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageNso.php */
-class LanguageNsoTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguagePlTest.php b/tests/phpunit/languages/LanguagePlTest.php
deleted file mode 100644 (file)
index d180037..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguagePl.php */
-class LanguagePlTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many' );
-               $this->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 array(
-                       array( 'many', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'many', 5 ),
-                       array( 'many', 9 ),
-                       array( 'many', 10 ),
-                       array( 'many', 11 ),
-                       array( 'many', 21 ),
-                       array( 'few', 22 ),
-                       array( 'few', 23 ),
-                       array( 'few', 24 ),
-                       array( 'many', 25 ),
-                       array( 'many', 200 ),
-                       array( 'many', 201 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       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 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageRoTest.php b/tests/phpunit/languages/LanguageRoTest.php
deleted file mode 100644 (file)
index ae7816b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageRo.php */
-class LanguageRoTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'few', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 19 ),
-                       array( 'other', 20 ),
-                       array( 'other', 99 ),
-                       array( 'other', 100 ),
-                       array( 'few', 101 ),
-                       array( 'few', 119 ),
-                       array( 'other', 120 ),
-                       array( 'other', 200 ),
-                       array( 'few', 201 ),
-                       array( 'few', 219 ),
-                       array( 'other', 220 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php
deleted file mode 100644 (file)
index 1381afb..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * based on LanguageBe_tarask.php
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageRu.php */
-class LanguageRuTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * Test explicit plural forms - n=FormN forms
-        * @covers Language::convertPlural
-        */
-       public function testExplicitPlural() {
-               $forms = array( 'one', 'few', 'many', 'other', '12=dozen' );
-               $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
-               $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' );
-               $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
-       }
-
-       /**
-        * @dataProvider providePlural
-        * @covers Language::getPluralRuleType
-        */
-       public function testGetPluralRuleType( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
-       }
-
-       public static function providePlural() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'many', 11 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'few', 334 ),
-                       array( 'many', 5 ),
-                       array( 'many', 15 ),
-                       array( 'many', 120 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( '1=one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'other', 11 ),
-                       array( 'other', 91 ),
-                       array( 'other', 121 ),
-               );
-       }
-
-       /**
-        * @dataProvider providerGrammar
-        * @covers Language::convertGrammar
-        */
-       public function testGrammar( $result, $word, $case ) {
-               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
-       }
-
-       public static function providerGrammar() {
-               return array(
-                       array(
-                               'Википедии',
-                               'Википедия',
-                               'genitive',
-                       ),
-                       array(
-                               'Викитеки',
-                               'Викитека',
-                               'genitive',
-                       ),
-                       array(
-                               'Викитеке',
-                               'Викитека',
-                               'prepositional',
-                       ),
-                       array(
-                               'Викисклада',
-                               'Викисклад',
-                               'genitive',
-                       ),
-                       array(
-                               'Викискладе',
-                               'Викисклад',
-                               'prepositional',
-                       ),
-                       array(
-                               'Викиданных',
-                               'Викиданные',
-                               'prepositional',
-                       ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSeTest.php b/tests/phpunit/languages/LanguageSeTest.php
deleted file mode 100644 (file)
index 533aa2b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageSe.php */
-class LanguageSeTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'other', 3 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 3 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSgsTest.php b/tests/phpunit/languages/LanguageSgsTest.php
deleted file mode 100644 (file)
index fa49a4d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for Samogitian */
-class LanguageSgsTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePluralAllForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralAllForms( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * @dataProvider providePluralAllForms
-        * @covers Language::getPluralRuleType
-        */
-       public function testGetPluralRuleType( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
-       }
-
-       public static function providePluralAllForms() {
-               return array(
-                       array( 'few', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'other', 3 ),
-                       array( 'few', 10 ),
-                       array( 'few', 11 ),
-                       array( 'few', 12 ),
-                       array( 'few', 19 ),
-                       array( 'other', 20 ),
-                       array( 'few', 100 ),
-                       array( 'one', 101 ),
-                       array( 'few', 111 ),
-                       array( 'few', 112 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 3 ),
-                       array( 'other', 10 ),
-                       array( 'other', 11 ),
-                       array( 'other', 12 ),
-                       array( 'other', 19 ),
-                       array( 'other', 20 ),
-                       array( 'other', 100 ),
-                       array( 'one', 101 ),
-                       array( 'other', 111 ),
-                       array( 'other', 112 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageShTest.php b/tests/phpunit/languages/LanguageShTest.php
deleted file mode 100644 (file)
index 1b39087..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for  srpskohrvatski / српскохрватски / Serbocroatian */
-class LanguageShTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 10 ),
-                       array( 'other', 11 ),
-                       array( 'other', 12 ),
-                       array( 'one', 101 ),
-                       array( 'few', 102 ),
-                       array( 'other', 111 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSkTest.php b/tests/phpunit/languages/LanguageSkTest.php
deleted file mode 100644 (file)
index cb8a13b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Amir E. Aharoni
- * based on LanguageSkTest.php
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageSk.php */
-class LanguageSkTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 11 ),
-                       array( 'other', 20 ),
-                       array( 'other', 25 ),
-                       array( 'other', 200 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSlTest.php b/tests/phpunit/languages/LanguageSlTest.php
deleted file mode 100644 (file)
index 9783dd8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
- * @author Santhosh Thottingal
- * @copyright Copyright © 2012, Amir E. Aharoni
- * based on LanguageSkTest.php
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageSl.php */
-class LanguageSlTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providerPlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'few', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * @dataProvider providerPlural
-        * @covers Language::getPluralRuleType
-        */
-       public function testGetPluralRuleType( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
-       }
-
-       public static function providerPlural() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'other', 5 ),
-                       array( 'other', 99 ),
-                       array( 'other', 100 ),
-                       array( 'one', 101 ),
-                       array( 'two', 102 ),
-                       array( 'few', 103 ),
-                       array( 'one', 201 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSmaTest.php b/tests/phpunit/languages/LanguageSmaTest.php
deleted file mode 100644 (file)
index 95cb333..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageSma.php */
-class LanguageSmaTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'two', 'other' );
-               $this->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 array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'two', 2 ),
-                       array( 'other', 3 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'other', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-                       array( 'other', 3 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageSrTest.php b/tests/phpunit/languages/LanguageSrTest.php
deleted file mode 100644 (file)
index bfb199f..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/**
- * PHPUnit tests for the Serbian language.
- * The language can be represented using two scripts:
- *  - Latin (SR_el)
- *  - Cyrillic (SR_ec)
- * Both representations seems to be bijective, hence MediaWiki can convert
- * from one script to the other.
- *
- * @author Antoine Musso <hashar at free dot fr>
- * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr>
- * @file
- *
- * @todo methods in test class should be tidied:
- *  - Should be split into separate test methods and data providers
- *  - Tests for LanguageConverter and Language should probably be separate..
- */
-
-/** Tests for MediaWiki languages/LanguageSr.php */
-class LanguageSrTest extends LanguageClassesTestCase {
-       /**
-        * @covers LanguageConverter::convertTo
-        */
-       public function testEasyConversions() {
-               $this->assertCyrillic(
-                       'шђчћжШЂЧЋЖ',
-                       'Cyrillic guessing characters'
-               );
-               $this->assertLatin(
-                       'šđč枊ĐČĆŽ',
-                       'Latin guessing characters'
-               );
-       }
-
-       /**
-        * @covers LanguageConverter::convertTo
-        */
-       public function testMixedConversions() {
-               $this->assertCyrillic(
-                       'шђчћжШЂЧЋЖ - šđčćž',
-                       'Mostly cyrillic characters'
-               );
-               $this->assertLatin(
-                       'šđč枊ĐČĆŽ - шђчћж',
-                       'Mostly latin characters'
-               );
-       }
-
-       /**
-        * @covers LanguageConverter::convertTo
-        */
-       public function testSameAmountOfLatinAndCyrillicGetConverted() {
-               $this->assertConverted(
-                       '4 latin: šđčć | 4 cyrillic: шђчћ',
-                       'sr-ec'
-               );
-               $this->assertConverted(
-                       '4 latin: šđčć | 4 cyrillic: шђчћ',
-                       'sr-el'
-               );
-       }
-
-       /**
-        * @author Nikola Smolenski
-        * @covers LanguageConverter::convertTo
-        */
-       public function testConversionToCyrillic() {
-               //A simple convertion of Latin to Cyrillic
-               $this->assertEquals( 'абвг',
-                       $this->convertToCyrillic( 'abvg' )
-               );
-               //Same as above, but assert that -{}-s must be removed and not converted
-               $this->assertEquals( 'ljабnjвгdž',
-                       $this->convertToCyrillic( '-{lj}-ab-{nj}-vg-{dž}-' )
-               );
-               //A simple convertion of Cyrillic to Cyrillic
-               $this->assertEquals( 'абвг',
-                       $this->convertToCyrillic( 'абвг' )
-               );
-               //Same as above, but assert that -{}-s must be removed and not converted
-               $this->assertEquals( 'ljабnjвгdž',
-                       $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{dž}-' )
-               );
-               //This text has some Latin, but is recognized as Cyrillic, so it should not be converted
-               $this->assertEquals( 'abvgшђжчћ',
-                       $this->convertToCyrillic( 'abvgшђжчћ' )
-               );
-               //Same as above, but assert that -{}-s must be removed
-               $this->assertEquals( 'љabvgњшђжчћџ',
-                       $this->convertToCyrillic( '-{љ}-abvg-{њ}-шђжчћ-{џ}-' )
-               );
-               //This text has some Cyrillic, but is recognized as Latin, so it should be converted
-               $this->assertEquals( 'абвгшђжчћ',
-                       $this->convertToCyrillic( 'абвгšđžčć' )
-               );
-               //Same as above, but assert that -{}-s must be removed and not converted
-               $this->assertEquals( 'ljабвгnjшђжчћdž',
-                       $this->convertToCyrillic( '-{lj}-абвг-{nj}-šđžčć-{dž}-' )
-               );
-               // Roman numerals are not converted
-               $this->assertEquals( 'а I б II в III г IV шђжчћ',
-                       $this->convertToCyrillic( 'a I b II v III g IV šđžčć' )
-               );
-       }
-
-       /**
-        * @covers LanguageConverter::convertTo
-        */
-       public function testConversionToLatin() {
-               //A simple convertion of Latin to Latin
-               $this->assertEquals( 'abcd',
-                       $this->convertToLatin( 'abcd' )
-               );
-               //A simple convertion of Cyrillic to Latin
-               $this->assertEquals( 'abcd',
-                       $this->convertToLatin( 'абцд' )
-               );
-               //This text has some Latin, but is recognized as Cyrillic, so it should be converted
-               $this->assertEquals( 'abcdšđžčć',
-                       $this->convertToLatin( 'abcdшђжчћ' )
-               );
-               //This text has some Cyrillic, but is recognized as Latin, so it should not be converted
-               $this->assertEquals( 'абцдšđžčć',
-                       $this->convertToLatin( 'абцдšđžčć' )
-               );
-       }
-
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'other' );
-               $this->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 array(
-                       array( 'one', 1 ),
-                       array( 'other', 11 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'few', 334 ),
-                       array( 'other', 5 ),
-                       array( 'other', 15 ),
-                       array( 'other', 120 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'other', 11 ),
-                       array( 'other', 4 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-               );
-       }
-
-       ##### HELPERS #####################################################
-       /**
-        *Wrapper to verify text stay the same after applying conversion
-        * @param string $text Text to convert
-        * @param string $variant Language variant 'sr-ec' or 'sr-el'
-        * @param string $msg Optional message
-        */
-       protected function assertUnConverted( $text, $variant, $msg = '' ) {
-               $this->assertEquals(
-                       $text,
-                       $this->convertTo( $text, $variant ),
-                       $msg
-               );
-       }
-
-       /**
-        * Wrapper to verify a text is different once converted to a variant.
-        * @param string $text Text to convert
-        * @param string $variant Language variant 'sr-ec' or 'sr-el'
-        * @param string $msg Optional message
-        */
-       protected function assertConverted( $text, $variant, $msg = '' ) {
-               $this->assertNotEquals(
-                       $text,
-                       $this->convertTo( $text, $variant ),
-                       $msg
-               );
-       }
-
-       /**
-        * Verifiy the given Cyrillic text is not converted when using
-        * using the cyrillic variant and converted to Latin when using
-        * the Latin variant.
-        * @param string $text Text to convert
-        * @param string $msg Optional message
-        */
-       protected function assertCyrillic( $text, $msg = '' ) {
-               $this->assertUnConverted( $text, 'sr-ec', $msg );
-               $this->assertConverted( $text, 'sr-el', $msg );
-       }
-
-       /**
-        * Verifiy the given Latin text is not converted when using
-        * using the Latin variant and converted to Cyrillic when using
-        * the Cyrillic variant.
-        * @param string $text Text to convert
-        * @param string $msg Optional message
-        */
-       protected function assertLatin( $text, $msg = '' ) {
-               $this->assertUnConverted( $text, 'sr-el', $msg );
-               $this->assertConverted( $text, 'sr-ec', $msg );
-       }
-
-       /** Wrapper for converter::convertTo() method*/
-       protected function convertTo( $text, $variant ) {
-               return $this->getLang()
-                       ->mConverter
-                       ->convertTo(
-                               $text, $variant
-                       );
-       }
-
-       protected function convertToCyrillic( $text ) {
-               return $this->convertTo( $text, 'sr-ec' );
-       }
-
-       protected function convertToLatin( $text ) {
-               return $this->convertTo( $text, 'sr-el' );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageTiTest.php b/tests/phpunit/languages/LanguageTiTest.php
deleted file mode 100644 (file)
index e225af9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageTi.php */
-class LanguageTiTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageTlTest.php b/tests/phpunit/languages/LanguageTlTest.php
deleted file mode 100644 (file)
index 20f5bd7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageTl.php */
-class LanguageTlTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'one', 2 ),
-                       array( 'other', 4 ),
-                       array( 'other', 6 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php
deleted file mode 100644 (file)
index 2c9905f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * @author Antoine Musso
- * @copyright Copyright © 2011, Antoine Musso
- * @file
- */
-
-/** Tests for MediaWiki languages/LanguageTr.php */
-class LanguageTrTest extends LanguageClassesTestCase {
-
-       /**
-        * See @bug 28040
-        * Credits to irc://irc.freenode.net/wikipedia-tr users:
-        *  - berm
-        *  - []LuCkY[]
-        *  - Emperyan
-        * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
-        * @dataProvider provideDottedAndDotlessI
-        * @covers Language::ucfirst
-        * @covers Language::lcfirst
-        */
-       public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
-               if ( $func == 'ucfirst' ) {
-                       $res = $this->getLang()->ucfirst( $input );
-               } elseif ( $func == 'lcfirst' ) {
-                       $res = $this->getLang()->lcfirst( $input );
-               } else {
-                       throw new MWException( __METHOD__ . " given an invalid function name '$func'" );
-               }
-
-               $msg = "Converting $inputCase case '$input' with $func should give '$expected'";
-
-               $this->assertEquals( $expected, $res, $msg );
-       }
-
-       public static function provideDottedAndDotlessI() {
-               return array(
-                       # function, input, input case, expected
-                       # Case changed:
-                       array( 'ucfirst', 'ı', 'lower', 'I' ),
-                       array( 'ucfirst', 'i', 'lower', 'İ' ),
-                       array( 'lcfirst', 'I', 'upper', 'ı' ),
-                       array( 'lcfirst', 'İ', 'upper', 'i' ),
-
-                       # Already using the correct case
-                       array( 'ucfirst', 'I', 'upper', 'I' ),
-                       array( 'ucfirst', 'İ', 'upper', 'İ' ),
-                       array( 'lcfirst', 'ı', 'lower', 'ı' ),
-                       array( 'lcfirst', 'i', 'lower', 'i' ),
-
-                       # A real example taken from bug 28040 using
-                       # http://tr.wikipedia.org/wiki/%C4%B0Phone
-                       array( 'lcfirst', 'iPhone', 'lower', 'iPhone' ),
-
-                       # next case is valid in Turkish but are different words if we
-                       # consider IPhone is English!
-                       array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ),
-
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageUkTest.php b/tests/phpunit/languages/LanguageUkTest.php
deleted file mode 100644 (file)
index 9051bcf..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * based on LanguageBe_tarask.php
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for Ukrainian */
-class LanguageUkTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'few', 'many', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       /**
-        * Test explicit plural forms - n=FormN forms
-        * @covers Language::convertPlural
-        */
-       public function testExplicitPlural() {
-               $forms = array( 'one', 'few', 'many', 'other', '12=dozen' );
-               $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
-               $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' );
-               $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
-       }
-
-       /**
-        * @dataProvider providePlural
-        * @covers Language::getPluralRuleType
-        */
-       public function testGetPluralRuleType( $result, $value ) {
-               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
-       }
-
-       public static function providePlural() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'many', 11 ),
-                       array( 'one', 91 ),
-                       array( 'one', 121 ),
-                       array( 'few', 2 ),
-                       array( 'few', 3 ),
-                       array( 'few', 4 ),
-                       array( 'few', 334 ),
-                       array( 'many', 5 ),
-                       array( 'many', 15 ),
-                       array( 'many', 120 ),
-               );
-       }
-
-       /**
-        * @dataProvider providePluralTwoForms
-        * @covers Language::convertPlural
-        */
-       public function testPluralTwoForms( $result, $value ) {
-               $forms = array( '1=one', 'other' );
-               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
-       }
-
-       public static function providePluralTwoForms() {
-               return array(
-                       array( 'one', 1 ),
-                       array( 'other', 11 ),
-                       array( 'other', 91 ),
-                       array( 'other', 121 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageUzTest.php b/tests/phpunit/languages/LanguageUzTest.php
deleted file mode 100644 (file)
index 4881103..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-/**
- * PHPUnit tests for the Uzbek language.
- * The language can be represented using two scripts:
- *  - Latin (uz-latn)
- *  - Cyrillic (uz-cyrl)
- *
- * @author Robin Pepermans
- * @author Antoine Musso <hashar at free dot fr>
- * @copyright Copyright © 2012, Robin Pepermans
- * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr>
- * @file
- *
- * @todo methods in test class should be tidied:
- *  - Should be split into separate test methods and data providers
- *  - Tests for LanguageConverter and Language should probably be separate..
- */
-
-/** Tests for MediaWiki languages/LanguageUz.php */
-class LanguageUzTest extends LanguageClassesTestCase {
-
-       /**
-        * @author Nikola Smolenski
-        * @covers LanguageConverter::convertTo
-        */
-       public function testConversionToCyrillic() {
-               // A convertion of Latin to Cyrillic
-               $this->assertEquals( 'абвгғ',
-                       $this->convertToCyrillic( 'abvggʻ' )
-               );
-               // Same as above, but assert that -{}-s must be removed and not converted
-               $this->assertEquals( 'ljабnjвгўоdb',
-                       $this->convertToCyrillic( '-{lj}-ab-{nj}-vgoʻo-{db}-' )
-               );
-               // A simple convertion of Cyrillic to Cyrillic
-               $this->assertEquals( 'абвг',
-                       $this->convertToCyrillic( 'абвг' )
-               );
-               // Same as above, but assert that -{}-s must be removed and not converted
-               $this->assertEquals( 'ljабnjвгdaž',
-                       $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{da}-ž' )
-               );
-       }
-
-       /**
-        * @covers LanguageConverter::convertTo
-        */
-       public function testConversionToLatin() {
-               // A simple convertion of Latin to Latin
-               $this->assertEquals( 'abdef',
-                       $this->convertToLatin( 'abdef' )
-               );
-               // A convertion of Cyrillic to Latin
-               $this->assertEquals( 'gʻabtsdOʻQyo',
-                       $this->convertToLatin( 'ғабцдЎҚё' )
-               );
-       }
-
-       ##### HELPERS #####################################################
-       /**
-        * Wrapper to verify text stay the same after applying conversion
-        * @param string $text Text to convert
-        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
-        * @param string $msg Optional message
-        */
-       protected function assertUnConverted( $text, $variant, $msg = '' ) {
-               $this->assertEquals(
-                       $text,
-                       $this->convertTo( $text, $variant ),
-                       $msg
-               );
-       }
-
-       /**
-        * Wrapper to verify a text is different once converted to a variant.
-        * @param string $text Text to convert
-        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
-        * @param string $msg Optional message
-        */
-       protected function assertConverted( $text, $variant, $msg = '' ) {
-               $this->assertNotEquals(
-                       $text,
-                       $this->convertTo( $text, $variant ),
-                       $msg
-               );
-       }
-
-       /**
-        * Verifiy the given Cyrillic text is not converted when using
-        * using the cyrillic variant and converted to Latin when using
-        * the Latin variant.
-        * @param string $text Text to convert
-        * @param string $msg Optional message
-        */
-       protected function assertCyrillic( $text, $msg = '' ) {
-               $this->assertUnConverted( $text, 'uz-cyrl', $msg );
-               $this->assertConverted( $text, 'uz-latn', $msg );
-       }
-
-       /**
-        * Verifiy the given Latin text is not converted when using
-        * using the Latin variant and converted to Cyrillic when using
-        * the Cyrillic variant.
-        * @param string $text Text to convert
-        * @param string $msg Optional message
-        */
-       protected function assertLatin( $text, $msg = '' ) {
-               $this->assertUnConverted( $text, 'uz-latn', $msg );
-               $this->assertConverted( $text, 'uz-cyrl', $msg );
-       }
-
-       /** Wrapper for converter::convertTo() method*/
-       protected function convertTo( $text, $variant ) {
-               return $this->getLang()->mConverter->convertTo( $text, $variant );
-       }
-
-       protected function convertToCyrillic( $text ) {
-               return $this->convertTo( $text, 'uz-cyrl' );
-       }
-
-       protected function convertToLatin( $text ) {
-               return $this->convertTo( $text, 'uz-latn' );
-       }
-}
diff --git a/tests/phpunit/languages/LanguageWaTest.php b/tests/phpunit/languages/LanguageWaTest.php
deleted file mode 100644 (file)
index d05196c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * @author Amir E. Aharoni
- * @copyright Copyright © 2012, Amir E. Aharoni
- * @file
- */
-
-/** Tests for MediaWiki languages/classes/LanguageWa.php */
-class LanguageWaTest extends LanguageClassesTestCase {
-       /**
-        * @dataProvider providePlural
-        * @covers Language::convertPlural
-        */
-       public function testPlural( $result, $value ) {
-               $forms = array( 'one', 'other' );
-               $this->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 array(
-                       array( 'one', 0 ),
-                       array( 'one', 1 ),
-                       array( 'other', 2 ),
-               );
-       }
-}
diff --git a/tests/phpunit/languages/classes/LanguageAmTest.php b/tests/phpunit/languages/classes/LanguageAmTest.php
new file mode 100644 (file)
index 0000000..a644f5e
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageAm.php */
+class LanguageAmTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageArTest.php b/tests/phpunit/languages/classes/LanguageArTest.php
new file mode 100644 (file)
index 0000000..7b48f23
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Based on LanguagMlTest
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageAr.php */
+class LanguageArTest extends LanguageClassesTestCase {
+       /**
+        * @covers Language::formatNum
+        * @todo split into a test and a dataprovider
+        */
+       public function testFormatNum() {
+               $this->assertEquals( '١٬٢٣٤٬٥٦٧', $this->getLang()->formatNum( '1234567' ) );
+               $this->assertEquals( '-١٢٫٨٩', $this->getLang()->formatNum( -12.89 ) );
+       }
+
+       /**
+        * Mostly to test the raw ascii feature.
+        * @dataProvider providerSprintfDate
+        * @covers Language::sprintfDate
+        */
+       public function testSprintfDate( $format, $date, $expected ) {
+               $this->assertEquals( $expected, $this->getLang()->sprintfDate( $format, $date ) );
+       }
+
+       public static function providerSprintfDate() {
+               return array(
+                       array(
+                               'xg "vs" g',
+                               '20120102030410',
+                               'يناير vs ٣'
+                       ),
+                       array(
+                               'xmY',
+                               '20120102030410',
+                               '١٤٣٣'
+                       ),
+                       array(
+                               'xnxmY',
+                               '20120102030410',
+                               '1433'
+                       ),
+                       array(
+                               'xN xmj xmn xN xmY',
+                               '20120102030410',
+                               ' 7 2  ١٤٣٣'
+                       ),
+               );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
+               $this->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 array(
+                       array( 'zero', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 9 ),
+                       array( 'few', 110 ),
+                       array( 'many', 11 ),
+                       array( 'many', 15 ),
+                       array( 'many', 99 ),
+                       array( 'many', 9999 ),
+                       array( 'other', 100 ),
+                       array( 'other', 102 ),
+                       array( 'other', 1000 ),
+                       array( 'other', 1.7 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageArqTest.php b/tests/phpunit/languages/classes/LanguageArqTest.php
new file mode 100644 (file)
index 0000000..3fa56d7
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Based on LanguageMlTest
+ * @author Joel Sahleen
+ * @copyright Copyright © 2014, Joel Sahleen
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageArq.php */
+class LanguageArqTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider provideNumber
+        * @covers Language::formatNum
+        */
+       public function testFormatNum( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
+       }
+
+       public static function provideNumber() {
+               return array(
+                       array( '1.234.567', '1234567'),
+                       array( '-12,89', -12.89 ),
+                       );
+       }
+
+}
diff --git a/tests/phpunit/languages/classes/LanguageBeTest.php b/tests/phpunit/languages/classes/LanguageBeTest.php
new file mode 100644 (file)
index 0000000..7bd586a
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageBe.php */
+class LanguageBeTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many', 'other' );
+               $this->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 array(
+                       array( 'one', 1 ),
+                       array( 'many', 11 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'few', 334 ),
+                       array( 'many', 5 ),
+                       array( 'many', 15 ),
+                       array( 'many', 120 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageBe_taraskTest.php b/tests/phpunit/languages/classes/LanguageBe_taraskTest.php
new file mode 100644 (file)
index 0000000..4dd5cdd
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+
+// @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps
+class LanguageBe_taraskTest extends LanguageClassesTestCase {
+       // @codingStandardsIgnoreEnd
+       /**
+        * Make sure the language code we are given is indeed
+        * be-tarask. This is to ensure LanguageClassesTestCase
+        * does not give us the wrong language.
+        */
+       public function testBeTaraskTestsUsesBeTaraskCode() {
+               $this->assertEquals( 'be-tarask',
+                       $this->getLang()->getCode()
+               );
+       }
+
+       /**
+        * @see bug 23156 & r64981
+        * @covers Language::commafy
+        */
+       public function testSearchRightSingleQuotationMarkAsApostroph() {
+               $this->assertEquals(
+                       "'",
+                       $this->getLang()->normalizeForSearch( '’' ),
+                       'bug 23156: U+2019 conversion to U+0027'
+               );
+       }
+
+       /**
+        * @see bug 23156 & r64981
+        * @covers Language::commafy
+        */
+       public function testCommafy() {
+               $this->assertEquals( '1,234,567', $this->getLang()->commafy( '1234567' ) );
+               $this->assertEquals( '12,345', $this->getLang()->commafy( '12345' ) );
+       }
+
+       /**
+        * @see bug 23156 & r64981
+        * @covers Language::commafy
+        */
+       public function testDoesNotCommafyFourDigitsNumber() {
+               $this->assertEquals( '1234', $this->getLang()->commafy( '1234' ) );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many', 'other' );
+               $this->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 array(
+                       array( 'one', 1 ),
+                       array( 'many', 11 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'few', 334 ),
+                       array( 'many', 5 ),
+                       array( 'many', 15 ),
+                       array( 'many', 120 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( '1=one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 11 ),
+                       array( 'other', 91 ),
+                       array( 'other', 121 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageBhoTest.php b/tests/phpunit/languages/classes/LanguageBhoTest.php
new file mode 100644 (file)
index 0000000..187bfbb
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageBho.php */
+class LanguageBhoTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageBsTest.php b/tests/phpunit/languages/classes/LanguageBsTest.php
new file mode 100644 (file)
index 0000000..7aca2ab
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for Croatian (hrvatski) */
+class LanguageBsTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'one', 21 ),
+                       array( 'few', 24 ),
+                       array( 'other', 25 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageCsTest.php b/tests/phpunit/languages/classes/LanguageCsTest.php
new file mode 100644 (file)
index 0000000..da9e6b8
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/Languagecs.php */
+class LanguageCsTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'other', 25 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageCuTest.php b/tests/phpunit/languages/classes/LanguageCuTest.php
new file mode 100644 (file)
index 0000000..0719317
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageCu.php */
+class LanguageCuTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'one', 11 ),
+                       array( 'other', 20 ),
+                       array( 'two', 22 ),
+                       array( 'few', 223 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageCyTest.php b/tests/phpunit/languages/classes/LanguageCyTest.php
new file mode 100644 (file)
index 0000000..eaf663a
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageCy.php */
+class LanguageCyTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'zero', 'one', 'two', 'few', 'many', 'other' );
+               $this->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 array(
+                       array( 'zero', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'many', 6 ),
+                       array( 'other', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'other', 22 ),
+                       array( 'other', 223 ),
+                       array( 'other', 200.00 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageDsbTest.php b/tests/phpunit/languages/classes/LanguageDsbTest.php
new file mode 100644 (file)
index 0000000..94c11bc
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageDsb.php */
+class LanguageDsbTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'one', 101 ),
+                       array( 'one', 90001 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 203 ),
+                       array( 'few', 4 ),
+                       array( 'other', 99 ),
+                       array( 'other', 555 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageFrTest.php b/tests/phpunit/languages/classes/LanguageFrTest.php
new file mode 100644 (file)
index 0000000..46b6501
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageFr.php */
+class LanguageFrTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageGaTest.php b/tests/phpunit/languages/classes/LanguageGaTest.php
new file mode 100644 (file)
index 0000000..c009f56
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageGa.php */
+class LanguageGaTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageGdTest.php b/tests/phpunit/languages/classes/LanguageGdTest.php
new file mode 100644 (file)
index 0000000..b89b4df
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012-2013, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageGd.php */
+class LanguageGdTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providerPlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providerPlural() {
+               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
+        * @covers Language::convertPlural
+        */
+       public function testExplicitPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other', '11=Form11', '12=Form12' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static 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 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageGvTest.php b/tests/phpunit/languages/classes/LanguageGvTest.php
new file mode 100644 (file)
index 0000000..e6a0cf0
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Test for Manx (Gaelg) language
+ *
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2013, Santhosh Thottingal
+ * @file
+ */
+
+class LanguageGvTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->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 array(
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 3 ),
+                       array( 'few', 20 ),
+                       array( 'one', 21 ),
+                       array( 'two', 22 ),
+                       array( 'other', 23 ),
+                       array( 'other', 50 ),
+                       array( 'few', 60 ),
+                       array( 'few', 80 ),
+                       array( 'few', 100 )
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHeTest.php b/tests/phpunit/languages/classes/LanguageHeTest.php
new file mode 100644 (file)
index 0000000..c382244
--- /dev/null
@@ -0,0 +1,132 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageHe.php */
+class LanguageHeTest extends LanguageClassesTestCase {
+       /**
+        * The most common usage for the plural forms is two forms,
+        * for singular and plural. In this case, the second form
+        * is technically dual, but in practice it's used as plural.
+        * In some cases, usually with expressions of time, three forms
+        * are needed - singular, dual and plural.
+        * CLDR also specifies a fourth form for multiples of 10,
+        * which is very rare. It also has a mistake, because
+        * the number 10 itself is supposed to be just plural,
+        * so currently it's overridden in MediaWiki.
+        */
+
+       // @todo the below test*PluralForms test methods can be refactored
+       //  to use a single test method and data provider..
+
+       /**
+        * @dataProvider provideTwoPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testTwoPluralForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider provideThreePluralForms
+        * @covers Language::convertPlural
+        */
+       public function testThreePluralForms( $result, $value ) {
+               $forms = array( 'one', 'two', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider provideFourPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testFourPluralForms( $result, $value ) {
+               $forms = array( 'one', 'two', 'many', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider provideFourPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function provideTwoPluralForms() {
+               return array(
+                       array( 'other', 0 ), // Zero - plural
+                       array( 'one', 1 ), // Singular
+                       array( 'other', 2 ), // No third form provided, use it as plural
+                       array( 'other', 3 ), // Plural - other
+                       array( 'other', 10 ), // No fourth form provided, use it as plural
+                       array( 'other', 20 ), // No fourth form provided, use it as plural
+               );
+       }
+
+       public static function provideThreePluralForms() {
+               return array(
+                       array( 'other', 0 ), // Zero - plural
+                       array( 'one', 1 ), // Singular
+                       array( 'two', 2 ), // Dual
+                       array( 'other', 3 ), // Plural - other
+                       array( 'other', 10 ), // No fourth form provided, use it as plural
+                       array( 'other', 20 ), // No fourth form provided, use it as plural
+               );
+       }
+
+       public static function provideFourPluralForms() {
+               return array(
+                       array( 'other', 0 ), // Zero - plural
+                       array( 'one', 1 ), // Singular
+                       array( 'two', 2 ), // Dual
+                       array( 'other', 3 ), // Plural - other
+                       array( 'other', 10 ), // 10 is supposed to be plural (other), not "many"
+                       array( 'many', 20 ), // Fourth form provided - rare, but supported by CLDR
+               );
+       }
+
+       /**
+        * @dataProvider provideGrammar
+        * @covers Language::convertGrammar
+        */
+       public function testGrammar( $result, $word, $case ) {
+               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+       }
+
+       // The comments in the beginning of the line help avoid RTL problems
+       // with text editors.
+       public static function provideGrammar() {
+               return array(
+                       array(
+                               /* result */'וויקיפדיה',
+                               /* word   */'ויקיפדיה',
+                               /* case   */'תחילית',
+                       ),
+                       array(
+                               /* result */'וולפגנג',
+                               /* word   */'וולפגנג',
+                               /* case   */'prefixed',
+                       ),
+                       array(
+                               /* result */'קובץ',
+                               /* word   */'הקובץ',
+                               /* case   */'תחילית',
+                       ),
+                       array(
+                               /* result */'־Wikipedia',
+                               /* word   */'Wikipedia',
+                               /* case   */'תחילית',
+                       ),
+                       array(
+                               /* result */'־1995',
+                               /* word   */'1995',
+                               /* case   */'תחילית',
+                       ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHiTest.php b/tests/phpunit/languages/classes/LanguageHiTest.php
new file mode 100644 (file)
index 0000000..f6d2c9e
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageHi.php */
+class LanguageHiTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHrTest.php b/tests/phpunit/languages/classes/LanguageHrTest.php
new file mode 100644 (file)
index 0000000..644c525
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageHr.php */
+class LanguageHrTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'one', 21 ),
+                       array( 'few', 24 ),
+                       array( 'other', 25 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHsbTest.php b/tests/phpunit/languages/classes/LanguageHsbTest.php
new file mode 100644 (file)
index 0000000..f95a43b
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageHsb.php */
+class LanguageHsbTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'one', 101 ),
+                       array( 'one', 90001 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 203 ),
+                       array( 'few', 4 ),
+                       array( 'other', 99 ),
+                       array( 'other', 555 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHuTest.php b/tests/phpunit/languages/classes/LanguageHuTest.php
new file mode 100644 (file)
index 0000000..ee9197d
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageHu.php */
+class LanguageHuTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageHyTest.php b/tests/phpunit/languages/classes/LanguageHyTest.php
new file mode 100644 (file)
index 0000000..92e0ef9
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for Armenian (Հայերեն) */
+class LanguageHyTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageKshTest.php b/tests/phpunit/languages/classes/LanguageKshTest.php
new file mode 100644 (file)
index 0000000..568a378
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageKsh.php */
+class LanguageKshTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other', 'zero' );
+               $this->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 array(
+                       array( 'zero', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageLnTest.php b/tests/phpunit/languages/classes/LanguageLnTest.php
new file mode 100644 (file)
index 0000000..10b3234
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageLn.php */
+class LanguageLnTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageLtTest.php b/tests/phpunit/languages/classes/LanguageLtTest.php
new file mode 100644 (file)
index 0000000..30642f6
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageLt.php */
+class LanguageLtTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 9 ),
+                       array( 'other', 10 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'one', 21 ),
+                       array( 'few', 32 ),
+                       array( 'one', 41 ),
+                       array( 'one', 40001 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testOneFewPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               // This fails for 21, but not sure why.
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 15 ),
+                       array( 'other', 20 ),
+                       array( 'one', 21 ),
+                       array( 'other', 22 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageLvTest.php b/tests/phpunit/languages/classes/LanguageLvTest.php
new file mode 100644 (file)
index 0000000..7120cfe
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for Latvian */
+class LanguageLvTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'zero', 'one', 'other' );
+               $this->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 array(
+                       array( 'zero', 0 ),
+                       array( 'one', 1 ),
+                       array( 'zero', 11 ),
+                       array( 'one', 21 ),
+                       array( 'zero', 411 ),
+                       array( 'other', 2 ),
+                       array( 'other', 9 ),
+                       array( 'zero', 12 ),
+                       array( 'other', 12.345 ),
+                       array( 'zero', 20 ),
+                       array( 'other', 22 ),
+                       array( 'one', 31 ),
+                       array( 'zero', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageMgTest.php b/tests/phpunit/languages/classes/LanguageMgTest.php
new file mode 100644 (file)
index 0000000..65e8fd7
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageMg.php */
+class LanguageMgTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 200 ),
+                       array( 'other', 123.3434 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageMkTest.php b/tests/phpunit/languages/classes/LanguageMkTest.php
new file mode 100644 (file)
index 0000000..ed15526
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for македонски/Macedonian */
+class LanguageMkTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'one', 11 ),
+                       array( 'one', 21 ),
+                       array( 'one', 411 ),
+                       array( 'other', 12.345 ),
+                       array( 'other', 20 ),
+                       array( 'one', 31 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageMlTest.php b/tests/phpunit/languages/classes/LanguageMlTest.php
new file mode 100644 (file)
index 0000000..4fa45ce
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2011, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageMl.php */
+class LanguageMlTest extends LanguageClassesTestCase {
+
+       /**
+        * @dataProvider providerFormatNum
+        * @see bug 29495
+        * @covers Language::formatNum
+        */
+       public function testFormatNum( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
+       }
+
+       public static function providerFormatNum() {
+               return array(
+                       array( '12,34,567', '1234567' ),
+                       array( '12,345', '12345' ),
+                       array( '1', '1' ),
+                       array( '123', '123' ),
+                       array( '1,234', '1234' ),
+                       array( '12,345.56', '12345.56' ),
+                       array( '12,34,56,79,81,23,45,678', '12345679812345678' ),
+                       array( '.12345', '.12345' ),
+                       array( '-12,00,000', '-1200000' ),
+                       array( '-98', '-98' ),
+                       array( '-98', -98 ),
+                       array( '-1,23,45,678', -12345678 ),
+                       array( '', '' ),
+                       array( '', null ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageMoTest.php b/tests/phpunit/languages/classes/LanguageMoTest.php
new file mode 100644 (file)
index 0000000..e0e54ca
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageMo.php */
+class LanguageMoTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 19 ),
+                       array( 'other', 20 ),
+                       array( 'other', 99 ),
+                       array( 'other', 100 ),
+                       array( 'few', 101 ),
+                       array( 'few', 119 ),
+                       array( 'other', 120 ),
+                       array( 'other', 200 ),
+                       array( 'few', 201 ),
+                       array( 'few', 219 ),
+                       array( 'other', 220 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageMtTest.php b/tests/phpunit/languages/classes/LanguageMtTest.php
new file mode 100644 (file)
index 0000000..96d2bc9
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageMt.php */
+class LanguageMtTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many', 'other' );
+               $this->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 array(
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 10 ),
+                       array( 'many', 11 ),
+                       array( 'many', 19 ),
+                       array( 'other', 20 ),
+                       array( 'other', 99 ),
+                       array( 'other', 100 ),
+                       array( 'other', 101 ),
+                       array( 'few', 102 ),
+                       array( 'few', 110 ),
+                       array( 'many', 111 ),
+                       array( 'many', 119 ),
+                       array( 'other', 120 ),
+                       array( 'other', 201 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 10 ),
+                       array( 'other', 11 ),
+                       array( 'other', 19 ),
+                       array( 'other', 20 ),
+                       array( 'other', 99 ),
+                       array( 'other', 100 ),
+                       array( 'other', 101 ),
+                       array( 'other', 102 ),
+                       array( 'other', 110 ),
+                       array( 'other', 111 ),
+                       array( 'other', 119 ),
+                       array( 'other', 120 ),
+                       array( 'other', 201 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageNlTest.php b/tests/phpunit/languages/classes/LanguageNlTest.php
new file mode 100644 (file)
index 0000000..26bd691
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2011, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageNl.php */
+class LanguageNlTest extends LanguageClassesTestCase {
+
+       /**
+        * @covers Language::formatNum
+        * @todo split into a test and a dataprovider
+        */
+       public function testFormatNum() {
+               $this->assertEquals( '1.234.567', $this->getLang()->formatNum( '1234567' ) );
+               $this->assertEquals( '12.345', $this->getLang()->formatNum( '12345' ) );
+               $this->assertEquals( '1', $this->getLang()->formatNum( '1' ) );
+               $this->assertEquals( '123', $this->getLang()->formatNum( '123' ) );
+               $this->assertEquals( '1.234', $this->getLang()->formatNum( '1234' ) );
+               $this->assertEquals( '12.345,56', $this->getLang()->formatNum( '12345.56' ) );
+               $this->assertEquals( ',1234556', $this->getLang()->formatNum( '.1234556' ) );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageNsoTest.php b/tests/phpunit/languages/classes/LanguageNsoTest.php
new file mode 100644 (file)
index 0000000..18efd73
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageNso.php */
+class LanguageNsoTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguagePlTest.php b/tests/phpunit/languages/classes/LanguagePlTest.php
new file mode 100644 (file)
index 0000000..d180037
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguagePl.php */
+class LanguagePlTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many' );
+               $this->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 array(
+                       array( 'many', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'many', 5 ),
+                       array( 'many', 9 ),
+                       array( 'many', 10 ),
+                       array( 'many', 11 ),
+                       array( 'many', 21 ),
+                       array( 'few', 22 ),
+                       array( 'few', 23 ),
+                       array( 'few', 24 ),
+                       array( 'many', 25 ),
+                       array( 'many', 200 ),
+                       array( 'many', 201 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       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 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageRoTest.php b/tests/phpunit/languages/classes/LanguageRoTest.php
new file mode 100644 (file)
index 0000000..ae7816b
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageRo.php */
+class LanguageRoTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 19 ),
+                       array( 'other', 20 ),
+                       array( 'other', 99 ),
+                       array( 'other', 100 ),
+                       array( 'few', 101 ),
+                       array( 'few', 119 ),
+                       array( 'other', 120 ),
+                       array( 'other', 200 ),
+                       array( 'few', 201 ),
+                       array( 'few', 219 ),
+                       array( 'other', 220 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageRuTest.php b/tests/phpunit/languages/classes/LanguageRuTest.php
new file mode 100644 (file)
index 0000000..1381afb
--- /dev/null
@@ -0,0 +1,115 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * based on LanguageBe_tarask.php
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageRu.php */
+class LanguageRuTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * Test explicit plural forms - n=FormN forms
+        * @covers Language::convertPlural
+        */
+       public function testExplicitPlural() {
+               $forms = array( 'one', 'few', 'many', 'other', '12=dozen' );
+               $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
+               $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' );
+               $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePlural() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'many', 11 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'few', 334 ),
+                       array( 'many', 5 ),
+                       array( 'many', 15 ),
+                       array( 'many', 120 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( '1=one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'other', 11 ),
+                       array( 'other', 91 ),
+                       array( 'other', 121 ),
+               );
+       }
+
+       /**
+        * @dataProvider providerGrammar
+        * @covers Language::convertGrammar
+        */
+       public function testGrammar( $result, $word, $case ) {
+               $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+       }
+
+       public static function providerGrammar() {
+               return array(
+                       array(
+                               'Википедии',
+                               'Википедия',
+                               'genitive',
+                       ),
+                       array(
+                               'Викитеки',
+                               'Викитека',
+                               'genitive',
+                       ),
+                       array(
+                               'Викитеке',
+                               'Викитека',
+                               'prepositional',
+                       ),
+                       array(
+                               'Викисклада',
+                               'Викисклад',
+                               'genitive',
+                       ),
+                       array(
+                               'Викискладе',
+                               'Викисклад',
+                               'prepositional',
+                       ),
+                       array(
+                               'Викиданных',
+                               'Викиданные',
+                               'prepositional',
+                       ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSeTest.php b/tests/phpunit/languages/classes/LanguageSeTest.php
new file mode 100644 (file)
index 0000000..533aa2b
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageSe.php */
+class LanguageSeTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 3 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 3 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSgsTest.php b/tests/phpunit/languages/classes/LanguageSgsTest.php
new file mode 100644 (file)
index 0000000..fa49a4d
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for Samogitian */
+class LanguageSgsTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePluralAllForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralAllForms( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider providePluralAllForms
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePluralAllForms() {
+               return array(
+                       array( 'few', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 3 ),
+                       array( 'few', 10 ),
+                       array( 'few', 11 ),
+                       array( 'few', 12 ),
+                       array( 'few', 19 ),
+                       array( 'other', 20 ),
+                       array( 'few', 100 ),
+                       array( 'one', 101 ),
+                       array( 'few', 111 ),
+                       array( 'few', 112 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 3 ),
+                       array( 'other', 10 ),
+                       array( 'other', 11 ),
+                       array( 'other', 12 ),
+                       array( 'other', 19 ),
+                       array( 'other', 20 ),
+                       array( 'other', 100 ),
+                       array( 'one', 101 ),
+                       array( 'other', 111 ),
+                       array( 'other', 112 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageShTest.php b/tests/phpunit/languages/classes/LanguageShTest.php
new file mode 100644 (file)
index 0000000..1b39087
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for  srpskohrvatski / српскохрватски / Serbocroatian */
+class LanguageShTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 10 ),
+                       array( 'other', 11 ),
+                       array( 'other', 12 ),
+                       array( 'one', 101 ),
+                       array( 'few', 102 ),
+                       array( 'other', 111 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSkTest.php b/tests/phpunit/languages/classes/LanguageSkTest.php
new file mode 100644 (file)
index 0000000..cb8a13b
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * based on LanguageSkTest.php
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageSk.php */
+class LanguageSkTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 11 ),
+                       array( 'other', 20 ),
+                       array( 'other', 25 ),
+                       array( 'other', 200 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSlTest.php b/tests/phpunit/languages/classes/LanguageSlTest.php
new file mode 100644 (file)
index 0000000..9783dd8
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * based on LanguageSkTest.php
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageSl.php */
+class LanguageSlTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providerPlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'few', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider providerPlural
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providerPlural() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'other', 5 ),
+                       array( 'other', 99 ),
+                       array( 'other', 100 ),
+                       array( 'one', 101 ),
+                       array( 'two', 102 ),
+                       array( 'few', 103 ),
+                       array( 'one', 201 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSmaTest.php b/tests/phpunit/languages/classes/LanguageSmaTest.php
new file mode 100644 (file)
index 0000000..95cb333
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageSma.php */
+class LanguageSmaTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'two', 'other' );
+               $this->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 array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'two', 2 ),
+                       array( 'other', 3 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'other', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+                       array( 'other', 3 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageSrTest.php b/tests/phpunit/languages/classes/LanguageSrTest.php
new file mode 100644 (file)
index 0000000..bfb199f
--- /dev/null
@@ -0,0 +1,249 @@
+<?php
+/**
+ * PHPUnit tests for the Serbian language.
+ * The language can be represented using two scripts:
+ *  - Latin (SR_el)
+ *  - Cyrillic (SR_ec)
+ * Both representations seems to be bijective, hence MediaWiki can convert
+ * from one script to the other.
+ *
+ * @author Antoine Musso <hashar at free dot fr>
+ * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr>
+ * @file
+ *
+ * @todo methods in test class should be tidied:
+ *  - Should be split into separate test methods and data providers
+ *  - Tests for LanguageConverter and Language should probably be separate..
+ */
+
+/** Tests for MediaWiki languages/LanguageSr.php */
+class LanguageSrTest extends LanguageClassesTestCase {
+       /**
+        * @covers LanguageConverter::convertTo
+        */
+       public function testEasyConversions() {
+               $this->assertCyrillic(
+                       'шђчћжШЂЧЋЖ',
+                       'Cyrillic guessing characters'
+               );
+               $this->assertLatin(
+                       'šđč枊ĐČĆŽ',
+                       'Latin guessing characters'
+               );
+       }
+
+       /**
+        * @covers LanguageConverter::convertTo
+        */
+       public function testMixedConversions() {
+               $this->assertCyrillic(
+                       'шђчћжШЂЧЋЖ - šđčćž',
+                       'Mostly cyrillic characters'
+               );
+               $this->assertLatin(
+                       'šđč枊ĐČĆŽ - шђчћж',
+                       'Mostly latin characters'
+               );
+       }
+
+       /**
+        * @covers LanguageConverter::convertTo
+        */
+       public function testSameAmountOfLatinAndCyrillicGetConverted() {
+               $this->assertConverted(
+                       '4 latin: šđčć | 4 cyrillic: шђчћ',
+                       'sr-ec'
+               );
+               $this->assertConverted(
+                       '4 latin: šđčć | 4 cyrillic: шђчћ',
+                       'sr-el'
+               );
+       }
+
+       /**
+        * @author Nikola Smolenski
+        * @covers LanguageConverter::convertTo
+        */
+       public function testConversionToCyrillic() {
+               //A simple convertion of Latin to Cyrillic
+               $this->assertEquals( 'абвг',
+                       $this->convertToCyrillic( 'abvg' )
+               );
+               //Same as above, but assert that -{}-s must be removed and not converted
+               $this->assertEquals( 'ljабnjвгdž',
+                       $this->convertToCyrillic( '-{lj}-ab-{nj}-vg-{dž}-' )
+               );
+               //A simple convertion of Cyrillic to Cyrillic
+               $this->assertEquals( 'абвг',
+                       $this->convertToCyrillic( 'абвг' )
+               );
+               //Same as above, but assert that -{}-s must be removed and not converted
+               $this->assertEquals( 'ljабnjвгdž',
+                       $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{dž}-' )
+               );
+               //This text has some Latin, but is recognized as Cyrillic, so it should not be converted
+               $this->assertEquals( 'abvgшђжчћ',
+                       $this->convertToCyrillic( 'abvgшђжчћ' )
+               );
+               //Same as above, but assert that -{}-s must be removed
+               $this->assertEquals( 'љabvgњшђжчћџ',
+                       $this->convertToCyrillic( '-{љ}-abvg-{њ}-шђжчћ-{џ}-' )
+               );
+               //This text has some Cyrillic, but is recognized as Latin, so it should be converted
+               $this->assertEquals( 'абвгшђжчћ',
+                       $this->convertToCyrillic( 'абвгšđžčć' )
+               );
+               //Same as above, but assert that -{}-s must be removed and not converted
+               $this->assertEquals( 'ljабвгnjшђжчћdž',
+                       $this->convertToCyrillic( '-{lj}-абвг-{nj}-šđžčć-{dž}-' )
+               );
+               // Roman numerals are not converted
+               $this->assertEquals( 'а I б II в III г IV шђжчћ',
+                       $this->convertToCyrillic( 'a I b II v III g IV šđžčć' )
+               );
+       }
+
+       /**
+        * @covers LanguageConverter::convertTo
+        */
+       public function testConversionToLatin() {
+               //A simple convertion of Latin to Latin
+               $this->assertEquals( 'abcd',
+                       $this->convertToLatin( 'abcd' )
+               );
+               //A simple convertion of Cyrillic to Latin
+               $this->assertEquals( 'abcd',
+                       $this->convertToLatin( 'абцд' )
+               );
+               //This text has some Latin, but is recognized as Cyrillic, so it should be converted
+               $this->assertEquals( 'abcdšđžčć',
+                       $this->convertToLatin( 'abcdшђжчћ' )
+               );
+               //This text has some Cyrillic, but is recognized as Latin, so it should not be converted
+               $this->assertEquals( 'абцдšđžčć',
+                       $this->convertToLatin( 'абцдšđžčć' )
+               );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'other' );
+               $this->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 array(
+                       array( 'one', 1 ),
+                       array( 'other', 11 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'few', 334 ),
+                       array( 'other', 5 ),
+                       array( 'other', 15 ),
+                       array( 'other', 120 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'other', 11 ),
+                       array( 'other', 4 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+               );
+       }
+
+       ##### HELPERS #####################################################
+       /**
+        *Wrapper to verify text stay the same after applying conversion
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'sr-ec' or 'sr-el'
+        * @param string $msg Optional message
+        */
+       protected function assertUnConverted( $text, $variant, $msg = '' ) {
+               $this->assertEquals(
+                       $text,
+                       $this->convertTo( $text, $variant ),
+                       $msg
+               );
+       }
+
+       /**
+        * Wrapper to verify a text is different once converted to a variant.
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'sr-ec' or 'sr-el'
+        * @param string $msg Optional message
+        */
+       protected function assertConverted( $text, $variant, $msg = '' ) {
+               $this->assertNotEquals(
+                       $text,
+                       $this->convertTo( $text, $variant ),
+                       $msg
+               );
+       }
+
+       /**
+        * Verifiy the given Cyrillic text is not converted when using
+        * using the cyrillic variant and converted to Latin when using
+        * the Latin variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
+        */
+       protected function assertCyrillic( $text, $msg = '' ) {
+               $this->assertUnConverted( $text, 'sr-ec', $msg );
+               $this->assertConverted( $text, 'sr-el', $msg );
+       }
+
+       /**
+        * Verifiy the given Latin text is not converted when using
+        * using the Latin variant and converted to Cyrillic when using
+        * the Cyrillic variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
+        */
+       protected function assertLatin( $text, $msg = '' ) {
+               $this->assertUnConverted( $text, 'sr-el', $msg );
+               $this->assertConverted( $text, 'sr-ec', $msg );
+       }
+
+       /** Wrapper for converter::convertTo() method*/
+       protected function convertTo( $text, $variant ) {
+               return $this->getLang()
+                       ->mConverter
+                       ->convertTo(
+                               $text, $variant
+                       );
+       }
+
+       protected function convertToCyrillic( $text ) {
+               return $this->convertTo( $text, 'sr-ec' );
+       }
+
+       protected function convertToLatin( $text ) {
+               return $this->convertTo( $text, 'sr-el' );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageTiTest.php b/tests/phpunit/languages/classes/LanguageTiTest.php
new file mode 100644 (file)
index 0000000..e225af9
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageTi.php */
+class LanguageTiTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageTlTest.php b/tests/phpunit/languages/classes/LanguageTlTest.php
new file mode 100644 (file)
index 0000000..20f5bd7
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageTl.php */
+class LanguageTlTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'one', 2 ),
+                       array( 'other', 4 ),
+                       array( 'other', 6 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageTrTest.php b/tests/phpunit/languages/classes/LanguageTrTest.php
new file mode 100644 (file)
index 0000000..2c9905f
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+/**
+ * @author Antoine Musso
+ * @copyright Copyright © 2011, Antoine Musso
+ * @file
+ */
+
+/** Tests for MediaWiki languages/LanguageTr.php */
+class LanguageTrTest extends LanguageClassesTestCase {
+
+       /**
+        * See @bug 28040
+        * Credits to irc://irc.freenode.net/wikipedia-tr users:
+        *  - berm
+        *  - []LuCkY[]
+        *  - Emperyan
+        * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
+        * @dataProvider provideDottedAndDotlessI
+        * @covers Language::ucfirst
+        * @covers Language::lcfirst
+        */
+       public function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
+               if ( $func == 'ucfirst' ) {
+                       $res = $this->getLang()->ucfirst( $input );
+               } elseif ( $func == 'lcfirst' ) {
+                       $res = $this->getLang()->lcfirst( $input );
+               } else {
+                       throw new MWException( __METHOD__ . " given an invalid function name '$func'" );
+               }
+
+               $msg = "Converting $inputCase case '$input' with $func should give '$expected'";
+
+               $this->assertEquals( $expected, $res, $msg );
+       }
+
+       public static function provideDottedAndDotlessI() {
+               return array(
+                       # function, input, input case, expected
+                       # Case changed:
+                       array( 'ucfirst', 'ı', 'lower', 'I' ),
+                       array( 'ucfirst', 'i', 'lower', 'İ' ),
+                       array( 'lcfirst', 'I', 'upper', 'ı' ),
+                       array( 'lcfirst', 'İ', 'upper', 'i' ),
+
+                       # Already using the correct case
+                       array( 'ucfirst', 'I', 'upper', 'I' ),
+                       array( 'ucfirst', 'İ', 'upper', 'İ' ),
+                       array( 'lcfirst', 'ı', 'lower', 'ı' ),
+                       array( 'lcfirst', 'i', 'lower', 'i' ),
+
+                       # A real example taken from bug 28040 using
+                       # http://tr.wikipedia.org/wiki/%C4%B0Phone
+                       array( 'lcfirst', 'iPhone', 'lower', 'iPhone' ),
+
+                       # next case is valid in Turkish but are different words if we
+                       # consider IPhone is English!
+                       array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ),
+
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageUkTest.php b/tests/phpunit/languages/classes/LanguageUkTest.php
new file mode 100644 (file)
index 0000000..9051bcf
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * based on LanguageBe_tarask.php
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for Ukrainian */
+class LanguageUkTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'few', 'many', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * Test explicit plural forms - n=FormN forms
+        * @covers Language::convertPlural
+        */
+       public function testExplicitPlural() {
+               $forms = array( 'one', 'few', 'many', 'other', '12=dozen' );
+               $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) );
+               $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' );
+               $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePlural() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'many', 11 ),
+                       array( 'one', 91 ),
+                       array( 'one', 121 ),
+                       array( 'few', 2 ),
+                       array( 'few', 3 ),
+                       array( 'few', 4 ),
+                       array( 'few', 334 ),
+                       array( 'many', 5 ),
+                       array( 'many', 15 ),
+                       array( 'many', 120 ),
+               );
+       }
+
+       /**
+        * @dataProvider providePluralTwoForms
+        * @covers Language::convertPlural
+        */
+       public function testPluralTwoForms( $result, $value ) {
+               $forms = array( '1=one', 'other' );
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       public static function providePluralTwoForms() {
+               return array(
+                       array( 'one', 1 ),
+                       array( 'other', 11 ),
+                       array( 'other', 91 ),
+                       array( 'other', 121 ),
+               );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageUzTest.php b/tests/phpunit/languages/classes/LanguageUzTest.php
new file mode 100644 (file)
index 0000000..4881103
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/**
+ * PHPUnit tests for the Uzbek language.
+ * The language can be represented using two scripts:
+ *  - Latin (uz-latn)
+ *  - Cyrillic (uz-cyrl)
+ *
+ * @author Robin Pepermans
+ * @author Antoine Musso <hashar at free dot fr>
+ * @copyright Copyright © 2012, Robin Pepermans
+ * @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr>
+ * @file
+ *
+ * @todo methods in test class should be tidied:
+ *  - Should be split into separate test methods and data providers
+ *  - Tests for LanguageConverter and Language should probably be separate..
+ */
+
+/** Tests for MediaWiki languages/LanguageUz.php */
+class LanguageUzTest extends LanguageClassesTestCase {
+
+       /**
+        * @author Nikola Smolenski
+        * @covers LanguageConverter::convertTo
+        */
+       public function testConversionToCyrillic() {
+               // A convertion of Latin to Cyrillic
+               $this->assertEquals( 'абвгғ',
+                       $this->convertToCyrillic( 'abvggʻ' )
+               );
+               // Same as above, but assert that -{}-s must be removed and not converted
+               $this->assertEquals( 'ljабnjвгўоdb',
+                       $this->convertToCyrillic( '-{lj}-ab-{nj}-vgoʻo-{db}-' )
+               );
+               // A simple convertion of Cyrillic to Cyrillic
+               $this->assertEquals( 'абвг',
+                       $this->convertToCyrillic( 'абвг' )
+               );
+               // Same as above, but assert that -{}-s must be removed and not converted
+               $this->assertEquals( 'ljабnjвгdaž',
+                       $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{da}-ž' )
+               );
+       }
+
+       /**
+        * @covers LanguageConverter::convertTo
+        */
+       public function testConversionToLatin() {
+               // A simple convertion of Latin to Latin
+               $this->assertEquals( 'abdef',
+                       $this->convertToLatin( 'abdef' )
+               );
+               // A convertion of Cyrillic to Latin
+               $this->assertEquals( 'gʻabtsdOʻQyo',
+                       $this->convertToLatin( 'ғабцдЎҚё' )
+               );
+       }
+
+       ##### HELPERS #####################################################
+       /**
+        * Wrapper to verify text stay the same after applying conversion
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
+        * @param string $msg Optional message
+        */
+       protected function assertUnConverted( $text, $variant, $msg = '' ) {
+               $this->assertEquals(
+                       $text,
+                       $this->convertTo( $text, $variant ),
+                       $msg
+               );
+       }
+
+       /**
+        * Wrapper to verify a text is different once converted to a variant.
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
+        * @param string $msg Optional message
+        */
+       protected function assertConverted( $text, $variant, $msg = '' ) {
+               $this->assertNotEquals(
+                       $text,
+                       $this->convertTo( $text, $variant ),
+                       $msg
+               );
+       }
+
+       /**
+        * Verifiy the given Cyrillic text is not converted when using
+        * using the cyrillic variant and converted to Latin when using
+        * the Latin variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
+        */
+       protected function assertCyrillic( $text, $msg = '' ) {
+               $this->assertUnConverted( $text, 'uz-cyrl', $msg );
+               $this->assertConverted( $text, 'uz-latn', $msg );
+       }
+
+       /**
+        * Verifiy the given Latin text is not converted when using
+        * using the Latin variant and converted to Cyrillic when using
+        * the Cyrillic variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
+        */
+       protected function assertLatin( $text, $msg = '' ) {
+               $this->assertUnConverted( $text, 'uz-latn', $msg );
+               $this->assertConverted( $text, 'uz-cyrl', $msg );
+       }
+
+       /** Wrapper for converter::convertTo() method*/
+       protected function convertTo( $text, $variant ) {
+               return $this->getLang()->mConverter->convertTo( $text, $variant );
+       }
+
+       protected function convertToCyrillic( $text ) {
+               return $this->convertTo( $text, 'uz-cyrl' );
+       }
+
+       protected function convertToLatin( $text ) {
+               return $this->convertTo( $text, 'uz-latn' );
+       }
+}
diff --git a/tests/phpunit/languages/classes/LanguageWaTest.php b/tests/phpunit/languages/classes/LanguageWaTest.php
new file mode 100644 (file)
index 0000000..d05196c
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @author Amir E. Aharoni
+ * @copyright Copyright © 2012, Amir E. Aharoni
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageWa.php */
+class LanguageWaTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = array( 'one', 'other' );
+               $this->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 array(
+                       array( 'one', 0 ),
+                       array( 'one', 1 ),
+                       array( 'other', 2 ),
+               );
+       }
+}