diff --git a/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php new file mode 100644 index 0000000..d01ea01 --- /dev/null +++ b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php @@ -0,0 +1,66 @@ +getBaseFieldDefinitions('menu_link_content'); + + $plugin_not_found = []; + + foreach ($field_definitions as $field_id => $field_definition) { + $view_display_options = $field_definition->getDisplayOptions('view'); + if (!empty($view_display_options) && !empty($view_display_options['type'])) { + try { + $field_formatter_manager->getDefinition($view_display_options['type']); + } + catch (PluginNotFoundException $e) { + $plugin_not_found[] = "PluginNotFoundException here for 'menu_link_content' entity type in '{$field_id}' field view display options. Original message: {$e->getMessage()}"; + } + } + $form_display_options = $field_definition->getDisplayOptions('form'); + if (!empty($form_display_options) && !empty($form_display_options['type'])) { + try { + $field_widget_manager->getDefinition($form_display_options['type']); + } + catch (PluginNotFoundException $e) { + $plugin_not_found[] = "PluginNotFoundException here for 'menu_link_content' entity type in '{$field_id}' field form display options. Original message: {$e->getMessage()}"; + } + } + } + + $this->assertEmpty($plugin_not_found, implode(" ", $plugin_not_found)); + } + +}