function WildcardHtmlSupportTest::providerGhsConfiguration

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

File

core/modules/ckeditor5/tests/src/Kernel/WildcardHtmlSupportTest.php, line 104

Class

WildcardHtmlSupportTest
@covers <a href="/api/drupal/core%21modules%21ckeditor5%21src%21Plugin%21CKEditor5PluginManager.php/class/CKEditor5PluginManager/11.x" title="Provides a CKEditor 5 plugin manager." class="local">\Drupal\ckeditor5\Plugin\CKEditor5PluginManager</a>::getCKEditor5PluginConfig @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public static function providerGhsConfiguration() : array {
    return [
        'empty source editing' => [
            '<p> <br>',
            [],
            [],
        ],
        'without wildcard' => [
            '<p> <br> <a href> <blockquote> <div data-llama>',
            [
                '<div data-llama>',
            ],
            [
                [
                    'name' => 'div',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                ],
            ],
            [
                'link',
                'blockQuote',
            ],
        ],
        '<$text-container> minimal configuration' => [
            '<p data-llama> <br>',
            [
                '<$text-container data-llama>',
            ],
            [
                [
                    'name' => 'p',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                ],
            ],
        ],
        '<$text-container> from multiple plugins' => [
            '<p data-llama class="text-align-left text-align-center text-align-right text-align-justify"> <br>',
            [
                '<$text-container data-llama>',
            ],
            [
                [
                    'name' => 'p',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                    'classes' => [
                        'regexp' => [
                            'pattern' => '/^(text-align-left|text-align-center|text-align-right|text-align-justify)$/',
                        ],
                    ],
                ],
            ],
            [
                'alignment',
            ],
        ],
        '<$text-container> with attribute from multiple plugins' => [
            '<p data-llama class> <br>',
            [
                '<$text-container data-llama>',
                '<p class>',
            ],
            [
                [
                    'name' => 'p',
                    'classes' => TRUE,
                ],
                [
                    'name' => 'p',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                    'classes' => [
                        'regexp' => [
                            'pattern' => '/^(text-align-left|text-align-center|text-align-right|text-align-justify)$/',
                        ],
                    ],
                ],
            ],
            [
                'alignment',
            ],
        ],
        '<$text-container> realistic configuration' => [
            '<p data-llama> <br> <a href> <blockquote> <div data-llama> <mark> <abbr title>',
            [
                '<$text-container data-llama>',
                '<div>',
                '<mark>',
                '<abbr title>',
            ],
            [
                [
                    'name' => 'div',
                ],
                [
                    'name' => 'mark',
                ],
                [
                    'name' => 'abbr',
                    'attributes' => [
                        [
                            'key' => 'title',
                            'value' => TRUE,
                        ],
                    ],
                ],
                [
                    'name' => 'p',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                ],
                [
                    'name' => 'div',
                    'attributes' => [
                        [
                            'key' => 'data-llama',
                            'value' => TRUE,
                        ],
                    ],
                ],
            ],
            [
                'link',
                'blockQuote',
            ],
        ],
    ];
}

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