You are here

public function CKEditor4to5UpgradeCompletenessTest::testOnlyOneUpgradePluginAllowedPerCKEditor5ConfigurableSubsetPlugin in Drupal 10

Tests that only one plugin can provide an upgrade path for a subset plugin.

File

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

Class

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

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public function testOnlyOneUpgradePluginAllowedPerCKEditor5ConfigurableSubsetPlugin() : void {
  $this
    ->enableModules([
    'ckeditor4to5upgrade_plugin_test',
  ]);
  \Drupal::state()
    ->set('ckeditor4to5upgrade_plugin_test', 'duplicate_subset');
  $this
    ->expectException(\OutOfBoundsException::class);
  $this
    ->expectExceptionMessage('The "ckeditor5_heading" CKEditor 5 plugin\'s elements subset configuration is already being computed by the "core" CKEditor4To5Upgrade plugin, the "foo" plugin is as well. This conflict needs to be resolved.');
  $this->upgradePluginManager
    ->computeCKEditor5PluginSubsetConfiguration('foo', FilterFormat::create());
}