You are here

public function InternalTest::formatTagsSettingsTestCases in Drupal 8

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 \Drupal\ckeditor\Plugin\CKEditorPlugin\Internal

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,
    ],
  ];
}