DrupalWebTestCase::assertField

  1. drupal
    1. 8
    2. 7
Versions
7 protected DrupalWebTestCase::assertField($field, $message = '', $group = 'Other')

Asserts that a field exists with the given name or id.

Parameters

$field Name or id of field to assert.

$message Message to display.

$group The group this message belongs to.

Return value

TRUE on pass, FALSE on fail.

Code

modules/simpletest/drupal_web_test_case.php, line 3198

<?php
protected function assertField($field, $message = '', $group = 'Other') {
  return $this->assertFieldByXPath($this->constructFieldXpath('name', $field) . '|' . $this->constructFieldXpath('id', $field), NULL, $message, $group);
}
?>