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