You are here

function SizeUnitTest::testCommonParseSizeFormatSize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Common/SizeUnitTest.php \Drupal\system\Tests\Common\SizeUnitTest::testCommonParseSizeFormatSize()

Cross-tests Bytes::toInt() and format_size().

File

core/modules/system/src/Tests/Common/SizeUnitTest.php, line 64
Contains \Drupal\system\Tests\Common\SizeUnitTest.

Class

SizeUnitTest
Parse a predefined amount of bytes and compare the output with the expected value.

Namespace

Drupal\system\Tests\Common

Code

function testCommonParseSizeFormatSize() {
  foreach ($this->exactTestCases as $size) {
    $this
      ->assertEqual($size, $parsed_size = Bytes::toInt($string = format_size($size, NULL)), $size . ' == ' . $parsed_size . ' (' . $string . ')');
  }
}