diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUICoreFieldsTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUICoreFieldsTest.php index 1b67199..2d8358c 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUICoreFieldsTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUICoreFieldsTest.php @@ -43,14 +43,15 @@ public function setUp() { * Ensures that entity types with bundles do not break following entity types. */ public function testFieldUICoreFields() { - entity_test_create_bundle('test_bundle'); + entity_test_create_bundle('test_bundle', 'Test bundle', 'entity_test_base_field_display'); // Make sure field found in manage view and form display. - $this->drupalGet('entity_test/structure/test_bundle/display'); - $this->assertText(t('Name')); - $this->assertField('fields[name][type]'); - $this->drupalGet('entity_test/structure/test_bundle/form-display'); - $this->assertText(t('Name')); - $this->assertField('fields[name][type]'); + $this->drupalGet('entity_test_base_field_display/structure/test_bundle'); + $this->drupalGet('entity_test_base_field_display/structure/test_bundle/display'); + $this->assertText(t('Field with configurable display')); + $this->assertField('fields[test_display_configurable][type]'); + $this->drupalGet('entity_test_base_field_display/structure/test_bundle/form-display'); + $this->assertText(t('Field with configurable display')); + $this->assertField('fields[test_display_configurable][type]'); } } diff --git a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module index 95d2dc4..ac53c61 100644 --- a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module +++ b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module @@ -33,24 +33,3 @@ function field_ui_test_field_widget_info_alter(&$info) { $info['text_textfield']['field_types'][] = 'string'; } } - -/** - * Implements hook_ENTITY_TYPE_field_info_alter(). - */ -function field_ui_test_entity_test_field_info_alter(&$info) { - // Allow to configure the name base field in field ui. - /** @var Drupal\Core\Field\FieldDefinitionInterface $definition */ - $definition = $info['definitions']['name']; - $definition - ->setDisplayOptions('view', array( - 'type' => 'text_default', - 'weight' => 10, - )) - ->setDisplayConfigurable('view', TRUE) - ->setDisplayOptions('form', array( - 'type' => 'text_textfield', - 'weight' => 10, - )) - ->setDisplayConfigurable('form', TRUE); - $info['definitions']['name'] = $definition; -} diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestBaseFieldDisplay.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestBaseFieldDisplay.php index 89085bd..034ee70 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestBaseFieldDisplay.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestBaseFieldDisplay.php @@ -48,7 +48,7 @@ public static function baseFieldDefinitions($entity_type) { $fields['test_no_display'] = FieldDefinition::create('text') ->setLabel(t('Field with no display')); - $fields['test_display_configurable'] = FieldDefinition::create('text') + $fields['test_display_configurable'] = FieldDefinition::create('string') ->setLabel(t('Field with configurable display')) ->setDisplayOptions('view', array( 'type' => 'text_default', diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/EntityTestRoutes.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/EntityTestRoutes.php index 7f608e6..66bf6f7 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/EntityTestRoutes.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Routing/EntityTestRoutes.php @@ -22,6 +22,7 @@ class EntityTestRoutes { */ public function routes() { $types = entity_test_entity_types(); + $types[] = 'entity_test_base_field_display'; $routes = array(); foreach ($types as $entity_type) {