4 * @covers ::wfShorthandToInteger
6 class WfShorthandToIntegerTest
extends MediaWikiTestCase
{
8 * @dataProvider provideABunchOfShorthands
10 public function testWfShorthandToInteger( $input, $output, $description ) {
12 wfShorthandToInteger( $input ),
18 public static function provideABunchOfShorthands() {
20 array( '', -1, 'Empty string' ),
21 array( ' ', -1, 'String of spaces' ),
22 array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ),
23 array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ),
24 array( '1M', 1024 * 1024, 'One meg uppercased' ),
25 array( '1m', 1024 * 1024, 'One meg lowercased' ),
26 array( '1K', 1024, 'One kb uppercased' ),
27 array( '1k', 1024, 'One kb lowercased' ),