protected function Select2Test::assertOptionNotExists in Select 2 8
Tests that a select option not exists.
Parameters
string $selector: The data-drupal-selector.
string $value: The value of the option.
2 calls to Select2Test::assertOptionNotExists()
- Select2Test::testAutocompleteOptions in tests/
src/ Kernel/ Element/ Select2Test.php - Tests that in autocomplete are only the default options rendered.
- Select2Test::testEmptyOption in tests/
src/ Kernel/ Element/ Select2Test.php - Tests that an empty option is added or not.
File
- tests/
src/ Kernel/ Element/ Select2Test.php, line 105
Class
- Select2Test
- @coversDefaultClass \Drupal\select2\Element\Select2
Namespace
Drupal\Tests\select2\Kernel\ElementCode
protected function assertOptionNotExists($selector, $value) {
$select = $this
->xpath('//select[@data-drupal-selector="' . $selector . '"]/option[@value="' . $value . '"]');
$this
->assertEquals(0, count($select));
}