wiki.techinc.nl/tests/phpunit/languages/LanguageDsbTest.php
Antoine Musso a03bf9e27f tests: rm duplicate code in language classes
The language classes have been using the same setUp() tearDown() to
craft a new language object. I have abstracted that code in
LanguageClassesTestCase and made all the language test classes to extend
it. The language is interpolated directly from the class name and an
object for it can be retrieved with the getLang() method.

Change-Id: Ib931336ce219edabe2c72b7e9f04c976a500723e
2012-10-29 09:40:30 +01:00

32 lines
737 B
PHP

<?php
/**
* @author Santhosh Thottingal
* @copyright Copyright © 2012, Santhosh Thottingal
* @file
*/
/** Tests for MediaWiki languages/classes/LanguageDsb.php */
class LanguageDsbTest extends LanguageClassesTestCase {
/** @dataProvider providePlural */
function testPlural( $result, $value ) {
$forms = array( 'one', 'two', 'few', 'other' );
$this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
}
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 ),
);
}
}