MediaWiki  REL1_19
LanguageSgsTest.php
Go to the documentation of this file.
00001 <?php
00009 class LanguageSgsTest extends MediaWikiTestCase {
00010         private $lang;
00011 
00012         function setUp() {
00013                 $this->lang = Language::factory( 'Sgs' );
00014         }
00015         function tearDown() {
00016                 unset( $this->lang );
00017         }
00018 
00020         function testPluralAllForms( $result, $value ) {
00021                 $forms = array( 'one', 'few', 'many', 'other' );
00022                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00023         }
00024 
00025         function providePluralAllForms() {
00026                 return array (
00027                         array( 'many',  0 ),
00028                         array( 'one',   1 ),
00029                         array( 'few',   2 ),
00030                         array( 'other', 3 ),
00031                         array( 'many',  10 ),
00032                         array( 'many',  11 ),
00033                         array( 'many',  12 ),
00034                         array( 'many',  19 ),
00035                         array( 'other', 20 ),
00036                         array( 'many',  100 ),
00037                         array( 'one',   101 ),
00038                         array( 'many',  111 ),
00039                         array( 'many',  112 ),
00040                 );
00041         }
00042 
00044         function testPluralTwoForms( $result, $value ) {
00045                 $forms =  array( 'one', 'other' );
00046                 $this->assertEquals( $result, $this->lang->convertPlural( $value, $forms ) );
00047         }
00048 
00049         function providePluralTwoForms() {
00050                 return array (
00051                         array( 'other', 0 ),
00052                         array( 'one',   1 ),
00053                         array( 'other', 2 ),
00054                         array( 'other', 3 ),
00055                         array( 'other', 10 ),
00056                         array( 'other', 11 ),
00057                         array( 'other', 12 ),
00058                         array( 'other', 19 ),
00059                         array( 'other', 20 ),
00060                         array( 'other', 100 ),
00061                         array( 'one',   101 ),
00062                         array( 'other', 111 ),
00063                         array( 'other', 112 ),
00064                 );
00065         }
00066 }