You are here

public function ColorTest::providerTestNormalizeHexLength in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::providerTestNormalizeHexLength()

Data provider for testNormalizeHexLength().

Return value

array An array of arrays containing:

  • The hex color value.
  • The 6 character length hex color value.

See also

testNormalizeHexLength()

File

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

Class

ColorTest
Tests Color utility class conversions.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestNormalizeHexLength() {
  $data = [
    [
      '#000',
      '#000000',
    ],
    [
      '#FFF',
      '#FFFFFF',
    ],
    [
      '#abc',
      '#aabbcc',
    ],
    [
      'cba',
      '#ccbbaa',
    ],
    [
      '#000000',
      '#000000',
    ],
    [
      'ffffff',
      '#ffffff',
    ],
    [
      '#010203',
      '#010203',
    ],
  ];
  return $data;
}