diff options
Diffstat (limited to 'tests/phpunit/languages/LanguageMgTest.php')
-rw-r--r-- | tests/phpunit/languages/LanguageMgTest.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/phpunit/languages/LanguageMgTest.php b/tests/phpunit/languages/LanguageMgTest.php index 06b56547..65e8fd7b 100644 --- a/tests/phpunit/languages/LanguageMgTest.php +++ b/tests/phpunit/languages/LanguageMgTest.php @@ -6,24 +6,26 @@ */ /** Tests for MediaWiki languages/classes/LanguageMg.php */ -class LanguageMgTest extends MediaWikiTestCase { - private $lang; - - function setUp() { - $this->lang = Language::factory( 'mg' ); - } - function tearDown() { - unset( $this->lang ); +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 */ - function testPlural( $result, $value ) { - $forms = array( 'one', 'other' ); - $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) ); + /** + * @dataProvider providePlural + * @covers Language::getPluralRuleType + */ + public function testGetPluralRuleType( $result, $value ) { + $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) ); } - function providePlural() { - return array ( + public static function providePlural() { + return array( array( 'one', 0 ), array( 'one', 1 ), array( 'other', 2 ), @@ -31,5 +33,4 @@ class LanguageMgTest extends MediaWikiTestCase { array( 'other', 123.3434 ), ); } - } |