Commit 9bd6e3ca authored by catch's avatar catch
Browse files

Issue #1397890 by sun: Fixed DrupalWebTestCase::assertFieldByName() outputs...

Issue #1397890 by sun: Fixed DrupalWebTestCase::assertFieldByName() outputs bogus assertion message when no  is passed.
parent 26f17682
......@@ -3138,8 +3138,21 @@ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '', $g
* @return
* TRUE on pass, FALSE on fail.
*/
protected function assertFieldByName($name, $value = '', $message = '') {
return $this->assertFieldByXPath($this->constructFieldXpath('name', $name), $value, $message ? $message : t('Found field by name @name', array('@name' => $name)), t('Browser'));
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'));
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment