aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-05-03 11:49:38 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-05-03 11:49:38 +0200
commit623161b9a92dacc54ce198e9f762c8760b73ca00 (patch)
treefec399a54168cfe7414d8ea591868a9600059bb4 /tests
parentcf20de185c95847810e6d0423d67f5bbc6506c2d (diff)
parent1245ff8f318fafd66eed1ba8f9f2b3755aa537ca (diff)
downloadnextcloud-server-623161b9a92dacc54ce198e9f762c8760b73ca00.tar.gz
nextcloud-server-623161b9a92dacc54ce198e9f762c8760b73ca00.zip
Merge pull request #8023 from flyser/master
Fix setting the max-upload-size for really large values.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/helper.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/helper.php b/tests/lib/helper.php
index 5d319e40f02..4aef4669cb3 100644
--- a/tests/lib/helper.php
+++ b/tests/lib/helper.php
@@ -31,6 +31,28 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
}
/**
+ * @dataProvider phpFileSizeProvider
+ */
+ public function testPhpFileSize($expected, $input)
+ {
+ $result = OC_Helper::phpFileSize($input);
+ $this->assertEquals($expected, $result);
+ }
+
+ public function phpFileSizeProvider()
+ {
+ return array(
+ array('0B', 0),
+ array('1K', 1024),
+ array('9.5M', 10000000),
+ array('1.3G', 1395864371),
+ array('465.7G', 500000000000),
+ array('465661.3G', 500000000000000),
+ array('465661287.3G', 500000000000000000),
+ );
+ }
+
+ /**
* @dataProvider computerFileSizeProvider
*/
function testComputerFileSize($expected, $input) {