summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-17 12:15:12 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-17 12:15:12 +0100
commit145db370d1e83978d0e575a60d7d61fbe1039cc4 (patch)
tree4322274789cb86cc05c7ca9ca87a45b8ffd58a0d /tests
parent518903c6eb865b7773e8953e5acb955551ad1674 (diff)
downloadnextcloud-server-145db370d1e83978d0e575a60d7d61fbe1039cc4.tar.gz
nextcloud-server-145db370d1e83978d0e575a60d7d61fbe1039cc4.zip
Correctly round bytes when converted from human readable format
Instead of leave two decimal places which is confusing, round the byte values correctly to the closest byte.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/helper.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 4311215795c..0943e6bc1b9 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -23,6 +23,7 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
array('0 B', 0),
array('1 kB', 1024),
array('9.5 MB', 10000000),
+ array('1.3 GB', 1395864371),
array('465.7 GB', 500000000000),
array('454.7 TB', 500000000000000),
array('444.1 PB', 500000000000000000),
@@ -41,8 +42,9 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
return array(
array(0.0, "0 B"),
array(1024.0, "1 kB"),
+ array(1395864371.0, '1.3 GB'),
array(9961472.0, "9.5 MB"),
- array(500041567436.8, "465.7 GB"),
+ array(500041567437.0, "465.7 GB"),
);
}