function CKEditor5UpdateImageToolbarItemTest::getFilterHtmlRestrictions

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

Gets the configured restrictions for the `filter_html` filter plugin.

Parameters

\Drupal\filter\FilterFormatInterface $format: Text format configured to use `filter_html`.

Return value

\Drupal\ckeditor5\HTMLRestrictions The configured HTML restrictions.

1 call to CKEditor5UpdateImageToolbarItemTest::getFilterHtmlRestrictions()
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 196

Class

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

Namespace

Drupal\Tests\ckeditor5\Functional\Update

Code

private static function getFilterHtmlRestrictions(FilterFormatInterface $format) : HTMLRestrictions {
    $allowed_html = $format->filters('filter_html')
        ->getConfiguration()['settings']['allowed_html'];
    return HTMLRestrictions::fromString($allowed_html);
}

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