1 backdrop_web_test_case.php protected BackdropWebTestCase::assertOption($id, $option, $message = '')

Asserts that a select option in the current page exists.

Parameters

$id: Id of select field to assert.

$option: Option to assert.

$message: Message to display.

Return value

TRUE on pass, FALSE on fail.:

File

core/modules/simpletest/backdrop_web_test_case.php, line 3745

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

protected function assertOption($id, $option, $message = '') {
  $options = $this->xpath('//select[@id=:id]//option[@value=:option]', array(':id' => $id, ':option' => $option));
  return $this->assertTrue(isset($options[0]), $message ? $message : t('Option @option for field @id exists.', array('@option' => $option, '@id' => $id)), t('Browser'));
}