Merge "Removed READ_LATEST default from Revision::newFromPageId()."
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageSgsTest.php
1 <?php
2 /**
3 * @author Amir E. Aharoni
4 * @copyright Copyright © 2012, Amir E. Aharoni
5 * @file
6 */
7
8 /** Tests for MediaWiki languages/classes/LanguageSgs.php */
9 class LanguageSgsTest extends MediaWikiTestCase {
10 private $lang;
11
12 protected function setUp() {
13 $this->lang = Language::factory( 'Sgs' );
14 }
15 protected function tearDown() {
16 unset( $this->lang );
17 }
18
19 /** @dataProvider providePluralAllForms */
20 function testPluralAllForms( $result, $value ) {
21 $forms = array( 'one', 'few', 'many', 'other' );
22 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
23 }
24
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 ),
40 );
41 }
42
43 /** @dataProvider providePluralTwoForms */
44 function testPluralTwoForms( $result, $value ) {
45 $forms = array( 'one', 'other' );
46 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
47 }
48
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 ),
64 );
65 }
66 }