You are here

private function BrowserKitDriver::getCheckboxField in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php \Behat\Mink\Driver\BrowserKitDriver::getCheckboxField()

Returns the checkbox field from xpath query, ensuring it is valid.

Parameters

string $xpath:

Return value

ChoiceFormField

Throws

DriverException when the field is not a checkbox

File

vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php, line 602

Class

BrowserKitDriver
Symfony2 BrowserKit driver.

Namespace

Behat\Mink\Driver

Code

private function getCheckboxField($xpath) {
  $field = $this
    ->getFormField($xpath);
  if (!$field instanceof ChoiceFormField) {
    throw new DriverException(sprintf('Impossible to check the element with XPath "%s" as it is not a checkbox', $xpath));
  }
  return $field;
}