Pull merge.
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Common / SizeTest.php
index 82ff53086ba3a006c40fc874fccb3f352c629331..f595cfcab5ec8dbfa2bf5aed11099fe62acae4ab 100644 (file)
@@ -29,8 +29,12 @@ class SizeTest extends KernelTestBase {
   public function providerTestCommonFormatSize() {
     $kb = Bytes::KILOBYTE;
     return [
+      ['0 bytes', 0],
       ['1 byte', 1],
+      ['-1 bytes', -1],
       ['2 bytes', 2],
+      ['-2 bytes', -2],
+      ['1023 bytes', $kb - 1],
       ['1 KB', $kb],
       ['1 MB', pow($kb, 2)],
       ['1 GB', pow($kb, 3)],
@@ -39,10 +43,13 @@ class SizeTest extends KernelTestBase {
       ['1 EB', pow($kb, 6)],
       ['1 ZB', pow($kb, 7)],
       ['1 YB', pow($kb, 8)],
-      // Rounded to 1 MB - not 1000 or 1024 kilobyte
+      ['1024 YB', pow($kb, 9)],
+      // Rounded to 1 MB - not 1000 or 1024 kilobytes
       ['1 MB', ($kb * $kb) - 1],
+      ['-1 MB', -(($kb * $kb) - 1)],
       // Decimal Megabytes
       ['3.46 MB', 3623651],
+      ['3.77 GB', 4053371676],
       // Decimal Petabytes
       ['59.72 PB', 67234178751368124],
       // Decimal Yottabytes