aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/UtilsTest.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php
index e5ff01e6..d6a0aad5 100644
--- a/tests/UtilsTest.php
+++ b/tests/UtilsTest.php
@@ -392,13 +392,14 @@ class UtilsTest extends PHPUnit_Framework_TestCase
392 $this->assertEquals('2GiB', human_bytes(strval(2 * (pow(1024, 3))))); 392 $this->assertEquals('2GiB', human_bytes(strval(2 * (pow(1024, 3)))));
393 $this->assertEquals('374B', human_bytes(374)); 393 $this->assertEquals('374B', human_bytes(374));
394 $this->assertEquals('374B', human_bytes('374')); 394 $this->assertEquals('374B', human_bytes('374'));
395 $this->assertEquals('232kiB', human_bytes(237481));
395 $this->assertEquals('Unlimited', human_bytes('0')); 396 $this->assertEquals('Unlimited', human_bytes('0'));
396 $this->assertEquals('Unlimited', human_bytes(0)); 397 $this->assertEquals('Unlimited', human_bytes(0));
397 $this->assertEquals('Setting not set', human_bytes('')); 398 $this->assertEquals('Setting not set', human_bytes(''));
398 } 399 }
399 400
400 /** 401 /**
401 * Test get_max_upload_size 402 * Test get_max_upload_size with formatting
402 */ 403 */
403 public function testGetMaxUploadSize() 404 public function testGetMaxUploadSize()
404 { 405 {
@@ -406,4 +407,14 @@ class UtilsTest extends PHPUnit_Framework_TestCase
406 $this->assertEquals('1MiB', get_max_upload_size('1m', '2m')); 407 $this->assertEquals('1MiB', get_max_upload_size('1m', '2m'));
407 $this->assertEquals('100B', get_max_upload_size(100, 100)); 408 $this->assertEquals('100B', get_max_upload_size(100, 100));
408 } 409 }
410
411 /**
412 * Test get_max_upload_size without formatting
413 */
414 public function testGetMaxUploadSizeRaw()
415 {
416 $this->assertEquals('1048576', get_max_upload_size(2097152, '1024k', false));
417 $this->assertEquals('1048576', get_max_upload_size('1m', '2m', false));
418 $this->assertEquals('100', get_max_upload_size(100, 100, false));
419 }
409} 420}