function CKEditor5PluginManagerTest::providerProvidedElementsInvalidElementSubset

Same name and namespace in other branches
  1. 9 core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5PluginManagerTest::providerProvidedElementsInvalidElementSubset()
  2. 11.x core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5PluginManagerTest::providerProvidedElementsInvalidElementSubset()

Data provider.

Return value

array Test scenarios.

File

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

Class

CKEditor5PluginManagerTest
Tests different ways of enabling CKEditor 5 plugins.

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public static function providerProvidedElementsInvalidElementSubset() : array {
  $random_tag_name = strtolower(Random::machineName());
  $random_tag = "<{$random_tag_name}>";
  return [
    'superset: random tag not listed in the plugin definition' => [
      [
        $random_tag,
      ],
      "The \"ckeditor5_plugin_elements_subset_sneakySuperset\" CKEditor 5 plugin implements ::getElementsSubset() and did not return a subset, the following tags are absent from the plugin definition: \"{$random_tag}\".",
    ],
    'subset that omits the essential creatable tag' => [
      [
        '<bar baz>',
      ],
      'The "ckeditor5_plugin_elements_subset_sneakySuperset" CKEditor 5 plugin implements ::getElementsSubset() and did return a subset ("<bar baz>") but the following tags can no longer be created: "<bar>".',
    ],
    'subset that tries to leverage the `<$any-html5-element>` wildcard tag but picks a concrete tag that the wildcard tag does not resolve into' => [
      [
        '<drupal-media class="sensational">',
      ],
      'The "ckeditor5_plugin_elements_subset_sneakySuperset" CKEditor 5 plugin implements ::getElementsSubset() and did not return a subset, the following tags are absent from the plugin definition: "<drupal-media class="sensational">".',
    ],
  ];
}

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