You are here

function FormTest::testEmptySelect in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Form/FormTest.php \Drupal\system\Tests\Form\FormTest::testEmptySelect()

Tests a select element when #options is not set.

File

core/modules/system/src/Tests/Form/FormTest.php, line 451
Contains \Drupal\system\Tests\Form\FormTest.

Class

FormTest
Tests various form element validation mechanisms.

Namespace

Drupal\system\Tests\Form

Code

function testEmptySelect() {
  $this
    ->drupalGet('form-test/empty-select');
  $this
    ->assertFieldByXPath("//select[1]", NULL, 'Select element found.');
  $this
    ->assertNoFieldByXPath("//select[1]/option", NULL, 'No option element found.');
}