Asserts that a select option in the current page is checked.
@todo $id is unusable. Replace with $name.
$id: ID of select field to assert.
$option: Option to assert.
$message: (optional) Message to display.
TRUE on pass, FALSE on fail.
protected function assertOptionSelected($id, $option, $message = '') {
$elements = $this
->xpath('//select[@id=:id]//option[@value=:option]', array(
':id' => $id,
':option' => $option,
));
return $this
->assertTrue(isset($elements[0]) && !empty($elements[0]['selected']), $message ? $message : t('Option @option for field @id is selected.', array(
'@option' => $option,
'@id' => $id,
)), t('Browser'));
}