1 backdrop_web_test_case.php | protected BackdropWebTestCase::assertFieldByName($name, $value = NULL, $message = NULL) |
Asserts that a field exists in the current page with the given name and value.
Parameters
$name: Name of field to assert.
$value: Value of the field to assert.
$message: Message to display.
$group: The group this message belongs to.
Return value
TRUE on pass, FALSE on fail.:
File
- core/
modules/ simpletest/ backdrop_web_test_case.php, line 3632
Class
- BackdropWebTestCase
- Test case for typical Backdrop tests.
Code
protected function assertFieldByName($name, $value = NULL, $message = NULL) {
if (!isset($message)) {
if (!isset($value)) {
$message = t('Found field with name @name', array(
'@name' => var_export($name, TRUE),
));
}
else {
$message = t('Found field with name @name and value @value', array(
'@name' => var_export($name, TRUE),
'@value' => var_export($value, TRUE),
));
}
}
return $this->assertFieldByXPath($this->constructFieldXpath('name', $name), $value, $message, t('Browser'));
}