function ElementsTableSelectTest::testEmptyText

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php \Drupal\Tests\system\Functional\Form\ElementsTableSelectTest::testEmptyText()
  2. 10 core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php \Drupal\Tests\system\Functional\Form\ElementsTableSelectTest::testEmptyText()
  3. 11.x core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php \Drupal\Tests\system\Functional\Form\ElementsTableSelectTest::testEmptyText()

Test the display of the #empty text when #options is an empty array.

File

core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php, line 89

Class

ElementsTableSelectTest
Tests the tableselect form element for expected behavior.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testEmptyText() {
    $this->drupalGet('form_test/tableselect/empty-text');
    $this->assertSession()
        ->pageTextContains('Empty text.', 'Empty text should be displayed.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.