protected function IntegrationTest::assertSelectOptionCanNotBeSelected in Views Entity Reference Filter 8
Asserts that no option with a given value can be selected in a select.
Parameters
string $locator: input id, name or label
string $value: option value
Throws
\Behat\Mink\Exception\ElementNotFoundException
1 call to IntegrationTest::assertSelectOptionCanNotBeSelected()
- IntegrationTest::testRegression2720953 in tests/
src/ Functional/ IntegrationTest.php - Tests that a user can only select items they have access to.
File
- tests/
src/ Functional/ IntegrationTest.php, line 146
Class
- IntegrationTest
- Tests the integration between Views Entity Reference Filter and Views.
Namespace
Drupal\Tests\verf\FunctionalCode
protected function assertSelectOptionCanNotBeSelected($locator, $value) {
try {
$this
->getSession()
->getPage()
->selectFieldOption($locator, $value);
} catch (ElementNotFoundException $e) {
// The element could not be found, which is good.
return;
}
throw new \AssertionError("{$value} could be selected in {$locator} while that should not be possible");
}