function ColorTest::testValidateHex

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

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

@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 27

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.