$this->
assertSession()->
statusCodeEquals(200
);
} /**
* Tests that persistent field storage appears in the field UI.
*/
protected function addPersistentFieldStorage() { $field_storage = FieldStorageConfig::
loadByName('node',
$this->fieldName
);
// Persist the field storage even if there are no fields.
$field_storage->
set('persist_with_no_fields', TRUE
)->
save();
// Delete all instances of the field.
foreach ($field_storage->
getBundles() as $node_type) { // Delete all the body field instances.
$this->
drupalGet('admin/structure/types/manage/' .
$node_type . '/fields/node.' .
$node_type . '.' .
$this->fieldName
);
$this->
clickLink('Delete'
);
$this->
submitForm([], 'Delete'
);
} // Check "Re-use existing field" appears.
$this->
drupalGet('admin/structure/types/manage/page/fields'
);
$this->
assertSession()->
pageTextContains('Re-use an existing field'
);
// Ensure that we test with a label that contains HTML.
$label =
$this->
randomString(4
) . '<br/>' .
$this->
randomString(4
);