protected function WebTestBase::assertFieldById

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

Parameters

$id: Id of field to assert.

$value: Value of the field to assert.

$message: (optional) A message to display with the assertion. Do not translate messages: use format_string() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

$group: (optional) The group this message is in, which is displayed in a column in test output. Use 'Debug' to indicate this is debugging output. Do not translate this string. Defaults to 'Browser'; most tests do not override this default.

Return value

TRUE on pass, FALSE on fail.

10 calls to WebTestBase::assertFieldById()
BulkFormTest::testBulkForm in drupal/core/modules/action/lib/Drupal/action/Tests/BulkFormTest.php
Tests the bulk form.
DisplayTest::testDisableDisplay in drupal/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.php
Tests disabling of a display.
DisplayTest::testRemoveDisplay in drupal/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.php
Tests removing a display.
EntityRevisionsTest::testRevisions in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityRevisionsTest.php
Check node revision related operations.
ExposedFormTest::testExposedAdminUi in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
Tests the admin interface of exposed filter and sort items.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 2664
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

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