You are here

public function BytesTest::testToNumber in Drupal 9

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 53

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));
}