Add another test case for shorthand to integer (lowercase too)
[lhc/web/wiklou.git] / tests / phpunit / includes / GlobalFunctions / wfShorthandToInteger.php
1 <?php
2
3 class wfShorthandToIntegerTest extends MediaWikiTestCase {
4 /**
5 * @dataProvider provideABunchOfShorthands
6 */
7 function testWfShorthandToInteger( $input, $output, $description ) {
8 $this->assertEquals(
9 wfShorthandToInteger( $input ),
10 $output,
11 $description
12 );
13 }
14
15 function provideABunchOfShorthands() {
16 return array(
17 array( '', -1, 'Empty string' ),
18 array( ' ', -1, 'String of spaces' ),
19 array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ),
20 array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ),
21 array( '1M', 1024 * 1024, 'One meg uppercased' ),
22 array( '1m', 1024 * 1024, 'One meg lowercased' ),
23 );
24 }
25
26 }