function IconPackManagerKernelTest::testGetExtractorPluginFormsWithAllowed

Test the IconPackManager::getExtractorPluginForms method.

File

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

Class

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

Namespace

Drupal\KernelTests\Core\Theme\Icon

Code

public function testGetExtractorPluginFormsWithAllowed() : void {
    $form_state = $this->getMockBuilder('Drupal\\Core\\Form\\FormState')
        ->disableOriginalConstructor()
        ->getMock();
    $form = [];
    $allowed_icon_pack['test_svg'] = '';
    $this->pluginManagerIconPack
        ->getExtractorPluginForms($form, $form_state, [], $allowed_icon_pack);
    $this->assertArrayHasKey('test_svg', $form);
    $this->assertArrayNotHasKey('test_minimal', $form);
    $this->assertArrayNotHasKey('test_svg_sprite', $form);
    $this->assertArrayNotHasKey('test_no_icons', $form);
}

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