function IconDefinitionTest::providerCreateIconHumanize

Data provider for ::testCreateIcon().

Return value

array The test cases with icon_id and expected label.

File

core/tests/Drupal/Tests/Core/Theme/Icon/IconDefinitionTest.php, line 177

Class

IconDefinitionTest
@coversDefaultClass \Drupal\Core\Theme\Icon\IconDefinition

Namespace

Drupal\Tests\Core\Theme\Icon

Code

public static function providerCreateIconHumanize() : array {
    return [
        'simple' => [
            'foo',
            'Foo',
        ],
        'with space' => [
            '  foo  ',
            'Foo',
        ],
        'with parts' => [
            'foo_bar',
            'Foo Bar',
        ],
        'with capital letters' => [
            'foo BAR bάz',
            'Foo Bar Bάz',
        ],
        'long with special characters' => [
            'foo --  Bar (1) -24',
            'Foo Bar124',
        ],
        'special characters' => [
            'j([{Fh- x1|_e$0__--Zr|7]ç$U_nE -B',
            'J Fh X1 E0 Zr7 Ç Un Eb',
        ],
    ];
}

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