function CKEditor5PluginManagerTest::providerTestPluginSupportingElement

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5PluginManagerTest::providerTestPluginSupportingElement()
  2. 10 core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5PluginManagerTest::providerTestPluginSupportingElement()

Provides use cases for findPluginSupportingElement().

File

core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php, line 1553

Class

CKEditor5PluginManagerTest
Tests different ways of enabling CKEditor 5 plugins.

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public static function providerTestPluginSupportingElement() {
    return [
        'tag that belongs to a superset' => [
            'tag' => 'h2',
            'expected_plugin_id' => 'ckeditor5_heading',
        ],
        'tag only available as tag' => [
            'tag' => 'nav',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_just_nav',
        ],
        'between just tag, full use of class, and constrained use of class, return full use of class' => [
            'tag' => 'article',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_article_class',
        ],
        'between just tag and full use of class, return full use of class' => [
            'tag' => 'footer',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_footer_class',
        ],
        'between just tag and constrained use of class, return constrained use of class' => [
            'tag' => 'aside',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_aside_class_with_values',
        ],
        'between full use of class and constrained use of class, return full use of class' => [
            'tag' => 'main',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_main_class',
        ],
        'between one plugin allows one attribute, second allows two, return the one that allows two' => [
            'tag' => 'figure',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_figure_two_attrib',
        ],
        'between one plugin allows one attribute, second allows two (but appearing in opposite order), still return the one that allows two' => [
            'tag' => 'dialog',
            'expected_plugin_id' => 'ckeditor5_definition_supporting_element_dialog_two_attrib',
        ],
        'tag that belongs to a plugin with conditions' => [
            'tag' => 'drupal-media',
            'expected_plugin_id' => NULL,
        ],
    ];
}

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