function SizeTest::testCommonFormatSize

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Common/SizeTest.php \Drupal\KernelTests\Core\Common\SizeTest::testCommonFormatSize()

Checks that format_size() returns the expected string.

@dataProvider providerTestCommonFormatSize

File

core/tests/Drupal/KernelTests/Core/Common/SizeTest.php, line 21

Class

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

Namespace

Drupal\KernelTests\Core\Common

Code

public function testCommonFormatSize($expected, $input) {
    $size = format_size($input, NULL);
    $this->assertEquals($expected, $size);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.