function CKEditor5UpdateImageToolbarItemTest::getSourceEditingRestrictions

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Functional/Update/CKEditor5UpdateImageToolbarItemTest.php \Drupal\Tests\ckeditor5\Functional\Update\CKEditor5UpdateImageToolbarItemTest::getSourceEditingRestrictions()
  2. 10 core/modules/ckeditor5/tests/src/Functional/Update/CKEditor5UpdateImageToolbarItemTest.php \Drupal\Tests\ckeditor5\Functional\Update\CKEditor5UpdateImageToolbarItemTest::getSourceEditingRestrictions()

Gets the configured HTML restrictions for the Source Editing plugin.

Parameters

\Drupal\editor\EditorInterface $editor: Text editor configured to use CKEditor 5, with Source Editing enabled.

Return value

\Drupal\ckeditor5\HTMLRestrictions The configured HTML restrictions.

1 call to CKEditor5UpdateImageToolbarItemTest::getSourceEditingRestrictions()
CKEditor5UpdateImageToolbarItemTest::test in core/modules/ckeditor5/tests/src/Functional/Update/CKEditor5UpdateImageToolbarItemTest.php
Tests that `uploadImage` toolbar item is updated to `drupalInsertImage`.

File

core/modules/ckeditor5/tests/src/Functional/Update/CKEditor5UpdateImageToolbarItemTest.php, line 191

Class

CKEditor5UpdateImageToolbarItemTest
Tests the update path for the CKEditor 5 image toolbar item.

Namespace

Drupal\Tests\ckeditor5\Functional\Update

Code

private static function getSourceEditingRestrictions(EditorInterface $editor) : HTMLRestrictions {
    $settings = $editor->getSettings();
    $source_editing_allowed_tags = $settings['plugins']['ckeditor5_sourceEditing']['allowed_tags'];
    return HTMLRestrictions::fromString(implode(' ', $source_editing_allowed_tags));
}

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