function InternalTest::formatTagsSettingsTestCases

Same name and namespace in other branches
  1. 9 core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php \Drupal\Tests\ckeditor\Kernel\Plugin\CKEditorPlugin\InternalTest::formatTagsSettingsTestCases()

A data provider for testFormatTagsSettings.

File

core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php, line 105

Class

InternalTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21ckeditor%21src%21Plugin%21CKEditorPlugin%21Internal.php/class/Internal/8.9.x" title="Defines the &quot;internal&quot; plugin (i.e. core plugins part of our CKEditor build)." class="local">\Drupal\ckeditor\Plugin\CKEditorPlugin\Internal</a>

Namespace

Drupal\Tests\ckeditor\Kernel\Plugin\CKEditorPlugin

Code

public function formatTagsSettingsTestCases() {
    $all_tags = [
        'p',
        'h1',
        'h2',
        'h3',
        'h4',
        'h5',
        'h6',
        'pre',
    ];
    return [
        'No filter plugins enabled (all tags allowed)' => [
            [],
            $all_tags,
        ],
        'HTML filter plugin enabled (some tags filtered out)' => [
            [
                'filter_html' => [
                    'status' => 1,
                    'settings' => [
                        'allowed_html' => '<h1> <h2>',
                        'filter_html_help' => 1,
                        'filter_html_nofollow' => 0,
                    ],
                ],
            ],
            [
                'p',
                'h1',
                'h2',
            ],
        ],
        'Test attribute filter enabled (all tags allowed)' => [
            [
                'test_attribute_filter' => [
                    'status' => 1,
                    'settings' => [
                        'tags' => [
                            'h1',
                            'h2',
                        ],
                    ],
                ],
            ],
            $all_tags,
        ],
    ];
}

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