function ExtractorTest::testDiscoverIconsExceptionSourceEmpty

Test the IconExtractorWithFinder:checkRequiredConfigSources method.

File

core/tests/Drupal/Tests/Core/Theme/Icon/Plugin/ExtractorTest.php, line 210

Class

ExtractorTest
Tests icon extractor with base and finder base plugin.

Namespace

Drupal\Tests\Core\Theme\Icon\Plugin

Code

public function testDiscoverIconsExceptionSourceEmpty() : void {
    $pathExtractorPlugin = new TestExtractorWithFinder([
        'config' => [
            'sources' => [],
        ],
    ], $this->pluginId, [], $this->createMock(IconFinder::class));
    $this->expectException(IconPackConfigErrorException::class);
    $this->expectExceptionMessage('Missing or invalid `config: sources` in your definition, extractor test_extractor requires this value as array.');
    $pathExtractorPlugin->discoverIcons();
}

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