You are here

public function TestSubContext::assertNotSeeRadioById in Drupal Commons 7.3

@Then I should not see the radio button :field with the id :id @Then I should not see the radio button :field

File

tests/steps/commons_test.behat.inc, line 584
Provide Behat step-definitions for generic Commons tests.

Class

TestSubContext

Code

public function assertNotSeeRadioById($field, $id = FALSE) {
  $element = $this
    ->getSession()
    ->getPage();
  $radiobutton = $id ? $element
    ->findById($id) : $element
    ->find('named', array(
    'radio',
    $this
      ->getSession()
      ->getSelectorsHandler()
      ->xpathLiteral($field),
  ));
  if ($radiobutton !== NULL) {
    throw new \Exception(sprintf('The radio button with "%s" was found on the page %s', $id ? $id : $field, $this
      ->getSession()
      ->getCurrentUrl()));
  }
}