// Test non-existent tables/fields.
$items =
[ [ 'table' => 'table_invalid',
'field' => 'id',
],
[ 'table' => 'views_test_data',
'field' => 'field_invalid',
],
];
$form_state =
new FormState();
$description_top = '<p>The handler for this item is broken or missing. The following details are available:</p>';
$description_bottom = '<p>Enabling the appropriate module may solve this issue. Otherwise, check to see if there is a module update available.</p>';
foreach ($types as $type =>
$class) { foreach ($items as $item) { $handler =
$this->container->
get('plugin.manager.views.' .
$type) ->
getHandler($item);
$this->
assertTrue($handler instanceof
$class);
// Make sure details available at edit form.
$form =
[];
$handler->
buildOptionsForm($form,
$form_state);
$this->
assertEquals($description_top,
$form['description'
]['description_top'
]['#markup'
]);