diff --git a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php index 2d76d76..0b359d9 100644 --- a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php +++ b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php @@ -50,6 +50,7 @@ function setUp() { $this->web_user = $this->drupalCreateUser(array( 'view test entity', 'administer entity_test content', + 'administer node fields', 'administer content types', )); $this->drupalLogin($this->web_user); @@ -89,11 +90,21 @@ function testEmailField() { )) ->save(); + $instance_id = 'entity_test.entity_test' . '.' . $field_name; + + // Go to the field instance edit page and set default value. + $this->drupalGet('admin/structure/types/manage/entity_test/fields/' . $instance_id); + $edit = array( + $field_name . '[und][0][value]' => 'default@example.com', + ); + $this->drupalPost(NULL, $edit, t('Save settings')); + // Display creation form. $this->drupalGet('entity_test/add'); $langcode = Language::LANGCODE_NOT_SPECIFIED; $this->assertFieldByName("{$field_name}[$langcode][0][value]", '', 'Widget found.'); $this->assertRaw('placeholder="example@example.com"'); + $this->assertRaw('value="default@example.com"'); // Submit a valid e-mail address and ensure it is accepted. $value = 'test@example.com';