4 * @group GlobalFunctions
5 * @covers ::wfShorthandToInteger
7 class WfShorthandToIntegerTest
extends MediaWikiTestCase
{
9 * @dataProvider provideABunchOfShorthands
11 public function testWfShorthandToInteger( $input, $output, $description ) {
13 wfShorthandToInteger( $input ),
19 public static function provideABunchOfShorthands() {
21 [ '', -1, 'Empty string' ],
22 [ ' ', -1, 'String of spaces' ],
23 [ '1G', 1024 * 1024 * 1024, 'One gig uppercased' ],
24 [ '1g', 1024 * 1024 * 1024, 'One gig lowercased' ],
25 [ '1M', 1024 * 1024, 'One meg uppercased' ],
26 [ '1m', 1024 * 1024, 'One meg lowercased' ],
27 [ '1K', 1024, 'One kb uppercased' ],
28 [ '1k', 1024, 'One kb lowercased' ],