1 field_ui.test FieldUITestCase::fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label)

Deletes a field instance through the Field UI.


$bundle_path: Admin path of the bundle that the field instance is to be deleted from.

$field_name: The name of the field.

$label: The label of the field.

$bundle_label: The label of the bundle.


core/modules/field_ui/tests/field_ui.test, line 130
Tests for field_ui.module.


Provides common functionality for the Field UI test classes.


function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) {
  // Display confirmation form.
  $this->assertRaw(t('Are you sure you want to delete the field %label', array('%label' => $label)), 'Delete confirmation was found.');

  // Submit confirmation form.
  $this->backdropPost(NULL, array(), t('Delete'));
  $this->assertRaw(t('The field %label has been deleted from the %type content type.', array('%label' => $label, '%type' => $bundle_label)), 'Delete message was found.');

  // Check that the field does not appear in the overview form.
  $this->assertNoFieldByXPath('//table[@id="field-overview"]//span[@class="label-field"]', $label, 'Field does not appear in the overview page.');