public function BytesTest::testValidate in Drupal 9
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 106
Class
- BytesTest
- Tests bytes size parsing helper methods.
Namespace
Drupal\Tests\Component\UtilityCode
public function testValidate($string, bool $expected_result) : void {
$this
->assertSame($expected_result, Bytes::validate($string));
}