function AddItemToToolbarConfigActionTest::testEmptyItemListIsRejected

Same name and namespace in other branches
  1. main core/modules/ckeditor5/tests/src/Kernel/ConfigAction/AddItemToToolbarConfigActionTest.php \Drupal\Tests\ckeditor5\Kernel\ConfigAction\AddItemToToolbarConfigActionTest::testEmptyItemListIsRejected()

Tests that an empty list of toolbar items is rejected.

File

core/modules/ckeditor5/tests/src/Kernel/ConfigAction/AddItemToToolbarConfigActionTest.php, line 144

Class

AddItemToToolbarConfigActionTest
Tests add item to toolbar config action.

Namespace

Drupal\Tests\ckeditor5\Kernel\ConfigAction

Code

public function testEmptyItemListIsRejected() : void {
  $this->expectException(ConfigActionException::class);
  $this->expectExceptionMessageIs('The editor:addItemsToToolbar config action requires one or more toolbar items.');
  $this->container
    ->get('plugin.manager.config_action')
    ->applyAction('editor:addItemsToToolbar', 'editor.editor.filter_test', []);
}

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