From: daniel Date: Tue, 26 Nov 2013 19:40:53 +0000 (+0100) Subject: (bug #56685) make sure commafy can deal with strings. X-Git-Tag: 1.31.0-rc.0~17887^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_user_edit%27%2C%20iduser=user.userid%29%20%7D%7D?a=commitdiff_plain;h=107bd92ec735faa115a322263951697d5aa65302;p=lhc%2Fweb%2Fwiklou.git (bug #56685) make sure commafy can deal with strings. Localization of numeric values should operate on the values as strings, and should handle strings representign very large numbers gracefully. Change-Id: I95394b96f9b70deb06ab818b54e08ac4ccb38c6c --- diff --git a/tests/phpunit/languages/LanguageTest.php b/tests/phpunit/languages/LanguageTest.php index f1babf50f1..e958fde412 100644 --- a/tests/phpunit/languages/LanguageTest.php +++ b/tests/phpunit/languages/LanguageTest.php @@ -1486,13 +1486,14 @@ class LanguageTest extends LanguageClassesTestCase { public static function provideCommafyData() { return array( - array( 1, '1' ), + array( -1, '-1' ), array( 10, '10' ), array( 100, '100' ), array( 1000, '1,000' ), array( 10000, '10,000' ), array( 100000, '100,000' ), array( 1000000, '1,000,000' ), + array( -1.0001, '-1.0001' ), array( 1.0001, '1.0001' ), array( 10.0001, '10.0001' ), array( 100.0001, '100.0001' ), @@ -1500,6 +1501,8 @@ class LanguageTest extends LanguageClassesTestCase { array( 10000.0001, '10,000.0001' ), array( 100000.0001, '100,000.0001' ), array( 1000000.0001, '1,000,000.0001' ), + array( '200000000000000000000', '200,000,000,000,000,000,000' ), + array( '-200000000000000000000', '-200,000,000,000,000,000,000' ), ); }