function BytesTest::testValidate
Same name in other branches
- 10 core/tests/Drupal/Tests/Component/Utility/BytesTest.php \Drupal\Tests\Component\Utility\BytesTest::testValidate()
- 11.x 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 107
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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.