function PathExtractorTest::providerDiscoverIconsPath

Data provider for ::testDiscoverIconsPath().

Return value

\Generator The test cases, icons data with expected result.

File

core/tests/Drupal/Tests/Core/Theme/Icon/Plugin/PathExtractorTest.php, line 67

Class

PathExtractorTest
@coversDefaultClass \Drupal\Core\Theme\Plugin\IconExtractor\PathExtractor

Namespace

Drupal\Tests\Core\Theme\Icon\Plugin

Code

public static function providerDiscoverIconsPath() : iterable {
    (yield 'empty files' => [
        [],
        TRUE,
    ]);
    (yield 'single file' => [
        [
            'foo' => [
                'icon_id' => 'foo',
                'source' => 'source/foo.svg',
                'absolute_path' => '/path/source/foo.svg',
            ],
        ],
    ]);
    (yield 'multiple files with group' => [
        [
            'foo' => [
                'icon_id' => 'foo',
                'source' => 'source/foo.svg',
                'absolute_path' => '/path/source/foo.svg',
                'group' => 'baz',
            ],
            'bar' => [
                'icon_id' => 'bar',
                'source' => 'source/bar.svg',
                'absolute_path' => '/path/source/bar.svg',
                'group' => NULL,
            ],
            'baz' => [
                'icon_id' => 'baz',
                'source' => 'source/baz.svg',
                'absolute_path' => '/path/source/baz.svg',
            ],
        ],
    ]);
}

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