You are here

public function SizeTest::testCommonFormatSize in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Common/SizeTest.php \Drupal\KernelTests\Core\Common\SizeTest::testCommonFormatSize()
  2. 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);
}