| 7 field_ui.test | FieldUITestCase::fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) |
| 8 field_ui.test | FieldUITestCase::fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) |
Deletes a field instance through the Field UI.
Parameters
$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.
File
- modules/
field_ui/ field_ui.test, line 119 - Tests for field_ui.module.
Code
function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) {
// Display confirmation form.
$this->drupalGet("$bundle_path/fields/$field_name/delete");
$this->assertRaw(t('Are you sure you want to delete the field %label', array('%label' => $label)), t('Delete confirmation was found.'));
// Submit confirmation form.
$this->drupalPost(NULL, array(), t('Delete'));
$this->assertRaw(t('The field %label has been deleted from the %type content type.', array('%label' => $label, '%type' => $bundle_label)), t('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, t('Field does not appear in the overview page.'));
}
Login or register to post comments