function ConfigActionsTest::testPlaceBlockActionOnlyWorksOnBlocks

Tests place block action only works on blocks.

Attributes

#[TestWith([ "placeBlockInDefaultTheme", ])] #[TestWith([ "placeBlockInAdminTheme", ])]

File

core/modules/block/tests/src/Kernel/ConfigActionsTest.php, line 87

Class

ConfigActionsTest
Tests Config Actions.

Namespace

Drupal\Tests\block\Kernel

Code

public function testPlaceBlockActionOnlyWorksOnBlocks(string $action) : void {
  $this->expectException(PluginNotFoundException::class);
  $this->expectExceptionMessage("The \"user_role\" entity does not support the \"{$action}\" config action.");
  $this->configActionManager
    ->applyAction($action, 'user.role.anonymous', []);
}

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