diff -u b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php --- b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php +++ b/core/modules/field/tests/src/Kernel/FieldDefinitionAvailabilityTest.php @@ -16,7 +16,16 @@ class FieldDefinitionAvailabilityTest extends KernelTestBase { /** + * Modules to enable. + * + * The test runner will merge the $modules lists from this class, the class + * it extends, and so on up the class hierarchy. It is not necessary to + * include modules in your list that a parent class has already declared. + * * @var array + * + * @see \Drupal\Tests\KernelTestBase::enableModules() + * @see \Drupal\Tests\KernelTestBase::bootKernel() */ public static $modules = ['system']; @@ -33,25 +42,15 @@ if ($module->origin === 'core' && empty($module->info['hidden']) && $module->status == FALSE - && $module->info['package'] !== 'Testing' - && ( - is_readable($module->getPath() . '/src/Entity') - || is_readable($module->getPath() . '/src/Plugin/Field') - )) { + && $module->info['package'] !== 'Testing') { return TRUE; } return FALSE; }); - if (!empty($modules['rest'])) { - unset($modules['rest']); - } $this->enableModules(array_keys($modules)); /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ - /*$field_type_manager = \Drupal::service('plugin.manager.field.field_type');*/ - - /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ $field_formatter_manager = \Drupal::service('plugin.manager.field.formatter'); /** @var \Drupal\Component\Plugin\Discovery\DiscoveryInterface $field_type_manager */ @@ -63,7 +62,6 @@ /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ $entity_type_manager = \Drupal::service('entity_type.manager'); - /** @var \Drupal\Core\Field\BaseFieldDefinition[][] $field_definitions */ $field_definitions = []; /** @var \Drupal\Core\Entity\EntityTypeInterface[] $content_entity_types */ @@ -84,7 +82,7 @@ $field_formatter_manager->getDefinition($view_display_options['type']); } catch (PluginNotFoundException $e) { - $plugin_not_found[] = "PluginNotFoundException here for '{$entity_type_id}' entity type in '{$field_id}' field view display options. Original message: {$e->getMessage()}"; + $plugin_not_found[] = "PluginNotFoundException here for \"{$entity_type_id}\" entity type in \"{$field_id}\" field view display options. Original message: {$e->getMessage()}"; } } $form_display_options = $field_definition->getDisplayOptions('form'); @@ -93,7 +91,7 @@ $field_widget_manager->getDefinition($form_display_options['type']); } catch (PluginNotFoundException $e) { - $plugin_not_found[] = "PluginNotFoundException here for '{$entity_type_id}' entity type in '{$field_id}' field form display options. Original message: {$e->getMessage()}"; + $plugin_not_found[] = "PluginNotFoundException here for \"{$entity_type_id}\" entity type in \"{$field_id}\" field form display options. Original message: {$e->getMessage()}"; } } }