public function DurationFieldBrowserTestBase::selectSelectOption in Duration Field 8
Same name and namespace in other branches
- 8.2 tests/src/Functional/DurationFieldBrowserTestBase.php \Drupal\Tests\duration_field\Functional\DurationFieldBrowserTestBase::selectSelectOption()
- 3.0.x tests/src/Functional/DurationFieldBrowserTestBase.php \Drupal\Tests\duration_field\Functional\DurationFieldBrowserTestBase::selectSelectOption()
Selects an option from a select element.
3 calls to DurationFieldBrowserTestBase::selectSelectOption()
- DurationFieldAccessTest::createDefaultSetup in tests/
src/ Functional/ DurationFieldFunctionalTest.php - Sets up a date.
- DurationFieldAccessTest::setFormatter in tests/
src/ Functional/ DurationFieldFunctionalTest.php - Sets the formatter to be tested.
- DurationFieldAccessTest::setHumanReadableOptions in tests/
src/ Functional/ DurationFieldFunctionalTest.php - Sets some human readable options.
File
- tests/
src/ Functional/ DurationFieldBrowserTestBase.php, line 116
Class
- DurationFieldBrowserTestBase
- Base class that provides some helper functions for functional tests.
Namespace
Drupal\Tests\duration_field\FunctionalCode
public function selectSelectOption($selectElementHtmlID, $value) {
if (preg_match('/^#/', $selectElementHtmlID)) {
$selectElementHtmlID = substr($selectElementHtmlID, 1);
}
$this
->getSession()
->getDriver()
->selectOption('//select[@id="' . $selectElementHtmlID . '"]', $value);
}