'#return_value' => 'visible',
],
'context_mapping' =>
[],
'display_message' =>
[ '#type' => 'textfield',
'#title' => 'Display message',
'#default_value' => 'My custom display message.',
],
];
$form_state =
new FormState();
// Ensure there are no form elements that do not belong to the plugin.
$actual_form =
$display_block->
buildConfigurationForm([],
$form_state);
// Remove the visibility sections, as that just tests condition plugins.
unset($actual_form['visibility'
],
$actual_form['visibility_tabs'
]);
$this->
assertEquals($expected_form,
$actual_form, 'Only the expected form elements were present.'
);
$expected_build =
[ '#children' => 'My custom display message.',
];
// Ensure the build array is proper.
$this->
assertSame($expected_build,
$display_block->
build(), 'The plugin returned the appropriate build array.'
);
// Ensure the machine name suggestion is correct. In truth, this is actually