Localisation updates from http://translatewiki.net.
[mediawiki.git] / tests / phpunit / languages / LanguageSgsTest.php
blob931c82f0b0b57abebec2682df89e3e6f7c0b721d
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
8 /** Tests for MediaWiki languages/classes/LanguageSgs.php */
9 class LanguageSgsTest extends MediaWikiTestCase {
10 private $lang;
12 function setUp() {
13 $this->lang = Language::factory( 'Sgs' );
15 function tearDown() {
16 unset( $this->lang );
19 /** @dataProvider providePluralAllForms */
20 function testPluralAllForms( $result, $value ) {
21 $forms = array( 'one', 'few', 'many', 'other' );
22 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
25 function providePluralAllForms() {
26 return array (
27 array( 'many', 0 ),
28 array( 'one', 1 ),
29 array( 'few', 2 ),
30 array( 'other', 3 ),
31 array( 'many', 10 ),
32 array( 'many', 11 ),
33 array( 'many', 12 ),
34 array( 'many', 19 ),
35 array( 'other', 20 ),
36 array( 'many', 100 ),
37 array( 'one', 101 ),
38 array( 'many', 111 ),
39 array( 'many', 112 ),
43 /** @dataProvider providePluralTwoForms */
44 function testPluralTwoForms( $result, $value ) {
45 $forms = array( 'one', 'other' );
46 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
49 function providePluralTwoForms() {
50 return array (
51 array( 'other', 0 ),
52 array( 'one', 1 ),
53 array( 'other', 2 ),
54 array( 'other', 3 ),
55 array( 'other', 10 ),
56 array( 'other', 11 ),
57 array( 'other', 12 ),
58 array( 'other', 19 ),
59 array( 'other', 20 ),
60 array( 'other', 100 ),
61 array( 'one', 101 ),
62 array( 'other', 111 ),
63 array( 'other', 112 ),