function ConfigActionsTest::testPlaceBlockActionOnlyWorksOnBlocks

@testWith ["placeBlockInDefaultTheme"]
["placeBlockInAdminTheme"]

File

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

Class

ConfigActionsTest
@covers \Drupal\block\Plugin\ConfigAction\PlaceBlock[[api-linebreak]] @covers \Drupal\block\Plugin\ConfigAction\PlaceBlockDeriver[[api-linebreak]] @group block

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.