function FieldUIManageFieldsTestCase::manageFieldsPage

Tests the manage fields page.

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

File

modules/field_ui/field_ui.test, line 176

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,
        )));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.