MediaWiki  REL1_22
wfShorthandToIntegerTest.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class WfShorthandToIntegerTest extends MediaWikiTestCase {
00010     public function testWfShorthandToInteger( $input, $output, $description ) {
00011         $this->assertEquals(
00012             wfShorthandToInteger( $input ),
00013             $output,
00014             $description
00015         );
00016     }
00017 
00018     public static function provideABunchOfShorthands() {
00019         return array(
00020             array( '', -1, 'Empty string' ),
00021             array( '     ', -1, 'String of spaces' ),
00022             array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ),
00023             array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ),
00024             array( '1M', 1024 * 1024, 'One meg uppercased' ),
00025             array( '1m', 1024 * 1024, 'One meg lowercased' ),
00026             array( '1K', 1024, 'One kb uppercased' ),
00027             array( '1k', 1024, 'One kb lowercased' ),
00028         );
00029     }
00030 }