You are here

protected function SalesforceMappingTestCase::checkRadioOptionSelected in Salesforce Suite 7.3

Helper to see if the given value is selected for the given radio field.

2 calls to SalesforceMappingTestCase::checkRadioOptionSelected()
SalesforceMappingTestCase::assertNoRadioOptionSelected in modules/salesforce_mapping/tests/salesforce_mapping.test
Assert if the given radio field does not have the given value selected.
SalesforceMappingTestCase::assertRadioOptionSelected in modules/salesforce_mapping/tests/salesforce_mapping.test
Assert if the given radio field has the given value selected.

File

modules/salesforce_mapping/tests/salesforce_mapping.test, line 398

Class

SalesforceMappingTestCase
Sets up basic tools for the testing of mapping Drupal to Salesforce.

Code

protected function checkRadioOptionSelected($name, $value) {
  $fields = $this
    ->xpath($this
    ->constructFieldXpath('name', $name));
  if (is_array($fields)) {
    foreach ($fields as $field) {
      if (isset($field['checked']) && $field['checked'] == 'checked') {
        if ($field['value'] == $value) {
          return TRUE;
        }
      }
    }
  }
  return FALSE;
}