diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php index 69f879e..78ce17d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFormTest.php @@ -52,9 +52,6 @@ function testFormCRUD() { */ function testEntityFormDisplayAlter() { $this->drupalGet('entity_test/add'); - $this->assertNoField('field_test_text[' . LANGUAGE_NOT_SPECIFIED . '][0][value]', 'The hidden field is not displayed'); - - $this->drupalGet('entity_test_mul/add'); $altered_field = $this->xpath('//input[@name="field_test_text[und][0][value]" and @size="42"]'); $this->assertTrue(count($altered_field) === 1, 'The altered field has the correct size value.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php index f0609a1..f049ac8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php @@ -42,13 +42,16 @@ function setUp() { field_create_field($field); $instance = array( - 'entity_type' => 'node', + 'entity_type' => 'user', 'field_name' => 'test_multiple', - 'bundle' => 'page', + 'bundle' => 'user', 'label' => 'Test a multiple valued field', + 'settings' => array( + 'user_register_form' => TRUE, + ), ); field_create_instance($instance); - entity_get_form_display('node', 'page', 'default') + entity_get_form_display('user', 'user', 'default') ->setComponent('test_multiple', array( 'type' => 'text_textfield', 'weight' => 0, diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index aedb91b..294672f 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -316,15 +316,8 @@ function entity_test_entity_field_access_alter(array &$grants, array $context) { * Implements hook_entity_form_display_alter(). */ function entity_test_entity_form_display_alter(EntityFormDisplay $form_display, $context) { - // Hide a field on the entity_test form. - if ($context['entity_type'] == 'entity_test') { - $form_display->setComponent('field_test_text', array( - 'type' => 'hidden', - )); - } - // Make the field_test_text field 42 characters for entity_test_mul. - if ($context['entity_type'] == 'entity_test_mul') { + if ($context['entity_type'] == 'entity_test') { if ($component_options = $form_display->getComponent('field_test_text')) { $component_options['settings']['size'] = 42; $form_display->setComponent('field_test_text', $component_options);