function IconPackManagerKernelTest::testProcessDefinitionExceptionRequired

Test the IconPackManager::processDefinition method with exception.

File

core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php, line 375

Class

IconPackManagerKernelTest
@coversDefaultClass \Drupal\Core\Theme\Icon\Plugin\IconPackManager

Namespace

Drupal\KernelTests\Core\Theme\Icon

Code

public function testProcessDefinitionExceptionRequired() : void {
    $definition = [
        'id' => 'foo',
        'provider' => 'icon_test',
    ];
    $this->pluginManagerIconPack
        ->setValidator();
    $this->expectException(IconPackConfigErrorException::class);
    $this->expectExceptionMessage('icon_test:foo Error in definition `foo`:[extractor] The property extractor is required, [template] The property template is required');
    $this->pluginManagerIconPack
        ->processDefinition($definition, 'foo');
}

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