'label' => 'Custom Display Message',
'label_display' => BlockPluginInterface::BLOCK_LABEL_VISIBLE,
'provider' => 'block_test',
'display_message' => 'no message set',
];
// Initial configuration of the block at construction time.
/** @var \Drupal\Core\Block\BlockPluginInterface $display_block */
$display_block =
$manager->
createInstance('test_block_instantiation',
$configuration);
$this->
assertSame($expected_configuration,
$display_block->
getConfiguration(), 'The block was configured correctly.'
);
// Updating an element of the configuration.
$display_block->
setConfigurationValue('display_message', 'My custom display message.'
);
$expected_configuration['display_message'
] = 'My custom display message.';
$this->
assertSame($expected_configuration,
$display_block->
getConfiguration(), 'The block configuration was updated correctly.'
);
$definition =
$display_block->
getPluginDefinition();
$expected_form =
[ 'provider' =>
[ '#type' => 'value',
'#value' => 'block_test',
],
'admin_label' =>
[ '#type' => 'item',