function CKEditor4to5UpgradeCompletenessTest::testCKEditor5ConfigurableSubsetPlugins

Tests that all elements subset plugins in core have an upgrade path.

File

core/modules/ckeditor5/tests/src/Kernel/CKEditor4to5UpgradeCompletenessTest.php, line 177

Class

CKEditor4to5UpgradeCompletenessTest
@covers \Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public function testCKEditor5ConfigurableSubsetPlugins() : void {
    $cke5_elements_subset_plugins = [];
    foreach ($this->cke5PluginManager
        ->getDefinitions() as $plugin_id => $definition) {
        // Special case: SourceEditing.
        // @see \Drupal\ckeditor5\SmartDefaultSettings::computeSubsetSettingForEnabledPluginsWithSubsets()
        if ($plugin_id === 'ckeditor5_sourceEditing') {
            continue;
        }
        if (is_a($definition->getClass(), CKEditor5PluginElementsSubsetInterface::class, TRUE)) {
            $cke5_elements_subset_plugins[] = $plugin_id;
        }
    }
    foreach ($cke5_elements_subset_plugins as $plugin_id) {
        $cke5_plugin_configuration = $this->upgradePluginManager
            ->computeCKEditor5PluginSubsetConfiguration($plugin_id, FilterFormat::create());
        $this->assertTrue($cke5_plugin_configuration === NULL || is_array($cke5_plugin_configuration));
    }
}

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