From b68134ac1d6a287e3a5003ccde137dd0c7ecdc52 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 3 Apr 2017 18:53:17 +0200 Subject: UtilsTest: PHP 5.5 compatibility --- tests/UtilsTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/UtilsTest.php') diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index e95c6248..e5ff01e6 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -366,10 +366,10 @@ class UtilsTest extends PHPUnit_Framework_TestCase { $this->assertEquals(2 * 1024, return_bytes('2k')); $this->assertEquals(2 * 1024, return_bytes('2K')); - $this->assertEquals(2 * (1024 ** 2), return_bytes('2m')); - $this->assertEquals(2 * (1024 ** 2), return_bytes('2M')); - $this->assertEquals(2 * (1024 ** 3), return_bytes('2g')); - $this->assertEquals(2 * (1024 ** 3), return_bytes('2G')); + $this->assertEquals(2 * (pow(1024, 2)), return_bytes('2m')); + $this->assertEquals(2 * (pow(1024, 2)), return_bytes('2M')); + $this->assertEquals(2 * (pow(1024, 3)), return_bytes('2g')); + $this->assertEquals(2 * (pow(1024, 3)), return_bytes('2G')); $this->assertEquals(374, return_bytes('374')); $this->assertEquals(374, return_bytes(374)); $this->assertEquals(0, return_bytes('0')); @@ -386,10 +386,10 @@ class UtilsTest extends PHPUnit_Framework_TestCase { $this->assertEquals('2kiB', human_bytes(2 * 1024)); $this->assertEquals('2kiB', human_bytes(strval(2 * 1024))); - $this->assertEquals('2MiB', human_bytes(2 * (1024 ** 2))); - $this->assertEquals('2MiB', human_bytes(strval(2 * (1024 ** 2)))); - $this->assertEquals('2GiB', human_bytes(2 * (1024 ** 3))); - $this->assertEquals('2GiB', human_bytes(strval(2 * (1024 ** 3)))); + $this->assertEquals('2MiB', human_bytes(2 * (pow(1024, 2)))); + $this->assertEquals('2MiB', human_bytes(strval(2 * (pow(1024, 2))))); + $this->assertEquals('2GiB', human_bytes(2 * (pow(1024, 3)))); + $this->assertEquals('2GiB', human_bytes(strval(2 * (pow(1024, 3))))); $this->assertEquals('374B', human_bytes(374)); $this->assertEquals('374B', human_bytes('374')); $this->assertEquals('Unlimited', human_bytes('0')); -- cgit v1.2.3