You are here

public function BytesTest::testToNumber in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/BytesTest.php \Drupal\Tests\Component\Utility\BytesTest::testToNumber()

Tests \Drupal\Component\Utility\Bytes::toNumber().

@dataProvider providerTestToNumber @covers ::toNumber

Parameters

string $size: The value for the size argument for \Drupal\Component\Utility\Bytes::toNumber().

float $expected_number: The expected return value from \Drupal\Component\Utility\Bytes::toNumber().

File

core/tests/Drupal/Tests/Component/Utility/BytesTest.php, line 33

Class

BytesTest
Tests bytes size parsing helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function testToNumber($size, float $expected_number) : void {
  $this
    ->assertSame($expected_number, Bytes::toNumber($size));
}