function DrupalWebTestCase::assertFieldById

Asserts that a field exists in the current page with the given ID and value.

Parameters

$id: ID of field to assert.

$value: (optional) Value for the field to assert. You may pass in NULL to skip checking the value, while still checking that the field exists. However, the default value ('') asserts that the field value is an empty string.

$message: (optional) Message to display.

$group: The group this message belongs to.

Return value

TRUE on pass, FALSE on fail.

2 calls to DrupalWebTestCase::assertFieldById()
FieldUIManageFieldsTestCase::testDefaultValue in modules/field_ui/field_ui.test
Tests that default value is correctly validated and saved.
FormsRebuildTestCase::testRebuildPreservesValues in modules/simpletest/tests/form.test
Tests preservation of values.

File

modules/simpletest/drupal_web_test_case.php, line 3760

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Code

protected function assertFieldById($id, $value = '', $message = '') {
    return $this->assertFieldByXPath($this->constructFieldXpath('id', $id), $value, $message ? $message : t('Found field by id @id', array(
        '@id' => $id,
    )), t('Browser'));
}

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