function CKEditor4to5UpgradeCompletenessTest::testOnlyOneUpgradePluginAllowedPerCKEditor4PluginSettings
Tests that only one plugin can provide an upgrade path for plugin settings.
File
-
core/
modules/ ckeditor5/ tests/ src/ Kernel/ CKEditor4to5UpgradeCompletenessTest.php, line 226
Class
- CKEditor4to5UpgradeCompletenessTest
- @covers <a href="/api/drupal/core%21modules%21ckeditor5%21src%21Plugin%21CKEditor4To5Upgrade%21Core.php/class/Core/9" title="Provides the CKEditor 4 to 5 upgrade for Drupal core's CKEditor plugins." class="local">\Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core</a> @group ckeditor5 @internal
Namespace
Drupal\Tests\ckeditor5\KernelCode
public function testOnlyOneUpgradePluginAllowedPerCKEditor4PluginSettings() : void {
$this->enableModules([
'ckeditor4to5upgrade_plugin_test',
]);
\Drupal::state()->set('ckeditor4to5upgrade_plugin_test', 'duplicate_plugin_settings');
$this->expectException(\OutOfBoundsException::class);
$this->expectExceptionMessage('The "stylescombo" CKEditor 4 plugin\'s settings are already being upgraded by the "core" CKEditor4To5Upgrade plugin, the "foo" plugin is as well. This conflict needs to be resolved.');
$this->upgradePluginManager
->mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem('foo', HTMLRestrictions::emptySet());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.