You are here

public function BytesTest::testToInt in Drupal 8

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

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

@dataProvider providerTestToInt @covers ::toInt

Parameters

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

int $expected_int: The expected return value from \Drupal\Component\Utility\Bytes::toInt().

File

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

Class

BytesTest
Tests bytes size parsing helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function testToInt($size, $expected_int) {
  $this
    ->assertEquals($expected_int, Bytes::toInt($size));
}