You are here

public function SocialMinkContext::iShouldSeeCheckedTheBox in Open Social 8.9

Same name and namespace in other branches
  1. 8.3 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  2. 8.4 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  3. 8.5 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  4. 8.6 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  5. 8.7 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  6. 8.8 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  7. 10.3.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  8. 10.0.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  9. 10.1.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()
  10. 10.2.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iShouldSeeCheckedTheBox()

@Then I should see checked the box :checkbox

File

tests/behat/features/bootstrap/SocialMinkContext.php, line 162

Class

SocialMinkContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

Code

public function iShouldSeeCheckedTheBox($checkbox) {
  $checkbox = $this
    ->fixStepArgument($checkbox);
  if (!$this
    ->getSession()
    ->getPage()
    ->hasCheckedField($checkbox)) {
    $field = $this
      ->getSession()
      ->getPage()
      ->findField($checkbox);
    if (null === $field) {
      throw new \Exception(sprintf('The checkbox "%s" with id|name|label|value was not found', $checkbox));
    }
    else {
      throw new \Exception(sprintf('The checkbox "%s" is not checked', $checkbox));
    }
  }
}