1.20.x backdrop_web_test_case.php protected BackdropWebTestCase::assertNoFieldChecked($id, $message = '')

Asserts that a checkbox field in the current page is not checked.

Parameters

$id: Id of field to assert.

$message: Message to display.

Return value

TRUE on pass, FALSE on fail.:

File

modules/simpletest/backdrop_web_test_case.php, line 3717

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

protected function assertNoFieldChecked($id, $message = '') {
  $elements = $this->xpath('//input[@id=:id]', array(':id' => $id));
  return $this->assertTrue(isset($elements[0]) && empty($elements[0]['checked']), $message ? $message : t('Checkbox field @id is not checked.', array('@id' => $id)), t('Browser'));
}