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