function ColorTest::testValidateHex

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testValidateHex()
  2. 9 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testValidateHex()
  3. 8.9.x core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testValidateHex()

@legacy-covers \Drupal\Component\Utility\Color::validateHex

Attributes

#[DataProvider('providerTestValidateHex')]

Parameters

bool $expected: The expected result of validation.

string $value: The hex color value.

File

core/tests/Drupal/Tests/Component/Utility/ColorTest.php, line 26

Class

ColorTest
Tests Color utility class conversions.

Namespace

Drupal\Tests\Component\Utility

Code

public function testValidateHex($expected, $value) : void {
  $this->assertSame($expected, Color::validateHex($value));
}

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