From d8dc3fdb11df586762899f7517f2055981f9d49f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 16 Oct 2011 18:35:32 +0000 Subject: [PATCH] Initial tests for wfShorthandToInteger(). Definitely needs more --- .../GlobalFunctions/wfShorthandToInteger.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/phpunit/includes/GlobalFunctions/wfShorthandToInteger.php 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' ), + ); + } + +} -- 2.20.1