public function ColorTest::testHexToRgb in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::testHexToRgb()
Tests Color::hexToRgb().
@dataProvider providerTestHexToRgb
Parameters
string $value: The hex color value.
string $expected: The expected rgb color value.
bool $invalid: Whether this value is invalid and exception should be expected.
File
- core/
tests/ Drupal/ Tests/ Component/ Utility/ ColorTest.php, line 32 - Contains \Drupal\Tests\Component\Utility\ColorTest.
Class
- ColorTest
- Tests Color utility class conversions.
Namespace
Drupal\Tests\Component\UtilityCode
public function testHexToRgb($value, $expected, $invalid = FALSE) {
if ($invalid) {
$this
->setExpectedException('InvalidArgumentException');
}
$this
->assertSame($expected, Color::hexToRgb($value));
}