]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
UtilsTest: PHP 5.5 compatibility 800/head
authorArthurHoaro <arthur@hoa.ro>
Mon, 3 Apr 2017 16:53:17 +0000 (18:53 +0200)
committerArthurHoaro <arthur@hoa.ro>
Mon, 3 Apr 2017 16:53:43 +0000 (18:53 +0200)
tests/UtilsTest.php

index e95c6248dadf1c866e0f28252f7de40d9b7c6a91..e5ff01e6e44f924c1c3d11a27c0dc29a6a00a3f9 100644 (file)
@@ -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'));