You are here

public function BytesTest::testValidate 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::testValidate()

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

@dataProvider providerTestValidate @covers ::validate

Parameters

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

bool $expected_result: The expected return value from \Drupal\Component\Utility\Bytes::validate().

File

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

Class

BytesTest
Tests bytes size parsing helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function testValidate($string, bool $expected_result) : void {
  $this
    ->assertSame($expected_result, Bytes::validate($string));
}