function FieldUIManageFieldsTestCase::manageFieldsPage

7.x field_ui.test FieldUIManageFieldsTestCase::manageFieldsPage()

Tests the manage fields page.

1 call to FieldUIManageFieldsTestCase::manageFieldsPage()
FieldUIManageFieldsTestCase::testCRUDFields in drupal-7.x/modules/field_ui/field_ui.test
Runs the field CRUD tests.

File

drupal-7.x/modules/field_ui/field_ui.test, line 170
Tests for field_ui.module.

Class

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

Code

function manageFieldsPage() {
  $this->drupalGet('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)));
  }
}