From: Chad Horohoe Date: Sun, 16 Oct 2011 18:35:32 +0000 (+0000) Subject: Initial tests for wfShorthandToInteger(). Definitely needs more X-Git-Tag: 1.31.0-rc.0~27066 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=d8dc3fdb11df586762899f7517f2055981f9d49f;p=lhc%2Fweb%2Fwiklou.git Initial tests for wfShorthandToInteger(). Definitely needs more --- diff --git a/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php b/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php new file mode 100644 index 0000000000..9b48e9b48d --- /dev/null +++ b/tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php @@ -0,0 +1,24 @@ +assertEquals( + wfShorthandToInteger( $input ), + $output, + $description + ); + } + + function provideABunchOfShorthands() { + return array( + array( '', -1, 'Empty string' ), + array( ' ', -1, 'String of spaces' ), + array( '1G', 1024 * 1024 * 1024, 'One gig uppercased' ), + array( '1g', 1024 * 1024 * 1024, 'One gig lowercased' ), + ); + } + +}