Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class wfShorthandToIntegerTest extends MediaWikiTestCase { |
| 5 | + /** |
| 6 | + * @dataProvider provideABunchOfShorthands |
| 7 | + */ |
| 8 | + function testWfShorthandToInteger( $input, $output, $description ) { |
| 9 | + $this->assertEquals( |
| 10 | + wfShorthandToInteger( $input ), |
| 11 | + $output, |
| 12 | + $description |
| 13 | + ); |
| 14 | + } |
| 15 | + |
| 16 | + function provideABunchOfShorthands() { |
| 17 | + return array( |
| 18 | + array( '', -1, 'Empty string' ), |
| 19 | + array( ' ', -1, 'String of spaces' ), |
| 20 | + array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ), |
| 21 | + array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ), |
| 22 | + ); |
| 23 | + } |
| 24 | + |
| 25 | +} |
Property changes on: trunk/phase3/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |