function SvgExtractorTest::providerDiscoverIconsSvg

Data provider for ::testDiscoverIconsSvg().

Return value

\Generator The test cases, icons files returned by IconFinder::getFilesFromSources.

File

core/tests/Drupal/Tests/Core/Theme/Icon/Plugin/SvgExtractorTest.php, line 70

Class

SvgExtractorTest
@coversDefaultClass \Drupal\Core\Theme\Plugin\IconExtractor\SvgExtractor[[api-linebreak]]

Namespace

Drupal\Tests\Core\Theme\Icon\Plugin

Code

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

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