function FormTest::testEmptySelect
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Form/FormTest.php \Drupal\Tests\system\Functional\Form\FormTest::testEmptySelect()
- 8.9.x core/modules/system/tests/src/Functional/Form/FormTest.php \Drupal\Tests\system\Functional\Form\FormTest::testEmptySelect()
- 10 core/modules/system/tests/src/Functional/Form/FormTest.php \Drupal\Tests\system\Functional\Form\FormTest::testEmptySelect()
Tests a select element when #options is not set.
File
-
core/
modules/ system/ tests/ src/ Functional/ Form/ FormTest.php, line 480
Class
- FormTest
- Tests various form element validation mechanisms.
Namespace
Drupal\Tests\system\Functional\FormCode
public function testEmptySelect() : void {
$this->drupalGet('form-test/empty-select');
$this->assertSession()
->elementExists('xpath', "//select[1]");
$this->assertSession()
->elementNotExists('xpath', "//select[1]/option");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.