function BytesTest::testToNumber

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Component/Utility/BytesTest.php \Drupal\Tests\Component\Utility\BytesTest::testToNumber()
  2. 11.x 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 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));
}

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