1 field_ui.test FieldUIManageFieldsTestCase::manageFieldsPage()

Tests the manage fields page.

File

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

Class

FieldUIManageFieldsTestCase
Tests the functionality of the 'Manage fields' screen.

Code

function manageFieldsPage() {
  $this->backdropGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields');
  // Check all table columns.
  $table_headers = array(
    t('Label'),
    t('Machine name'),
    t('Field type'),
    t('Widget'),
    t('Operations'),
  );
  foreach ($table_headers as $table_header) {
    // We check that the label appear in the table headings.
    $this->assertRaw($table_header . '</th>', format_string('%table_header table header was found.', array('%table_header' => $table_header)));
  }

  // "Add new field" and "Add existing field" aren't a table heading so just
  // test the text.
  foreach (array('Add new field', 'Add existing field') as $element) {
    $this->assertText($element, format_string('"@element" was found.', array('@element' => $element)));
  }
}