diff --git a/core/modules/field_ui/src/Tests/FieldUiTestTrait.php b/core/modules/field_ui/src/Tests/FieldUiTestTrait.php index 8b14eda..ec0e326 100644 --- a/core/modules/field_ui/src/Tests/FieldUiTestTrait.php +++ b/core/modules/field_ui/src/Tests/FieldUiTestTrait.php @@ -86,6 +86,11 @@ public function fieldUIAddExistingField($bundle_path, $existing_storage_name, $l // First step: 'Re-use existing field' on the 'Add field' page. $this->drupalPostForm("$bundle_path/fields/add-field", $initial_edit, t('Save and continue')); + // Set the main content to only the content region because the label can + // contain HTML which will be auto-escaped by Twig. + $main_content = $this->cssSelect('.region-content'); + $this->setRawContent(reset($main_content)->asXml()); + $this->assertRaw('field-config-edit-form', 'The field config edit form is present.'); $this->assertNoRaw('<', 'The page does not have double escaped HTML tags.'); // Second step: 'Field settings' form. diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index b4acad4..0d365aa 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -305,8 +305,11 @@ protected function addPersistentFieldStorage() { // Check "Re-use existing field" appears. $this->drupalGet('admin/structure/types/manage/page/fields/add-field'); $this->assertRaw(t('Re-use an existing field'), '"Re-use existing field" was found.'); + + // Ensure that we test with a label that contains HTML. + $label = $this->randomString(4) . '
' . $this->randomString(4); // Add a new field for the orphaned storage. - $this->fieldUIAddExistingField("admin/structure/types/manage/page", $this->fieldName); + $this->fieldUIAddExistingField("admin/structure/types/manage/page", $this->fieldName, $label); } /**