function ColorTest::providerTestNormalizeHexLength

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::providerTestNormalizeHexLength()
  2. 10 core/tests/Drupal/Tests/Component/Utility/ColorTest.php \Drupal\Tests\Component\Utility\ColorTest::providerTestNormalizeHexLength()
  3. 11.x 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;
}

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