You are here

public function ElementsVerticalTabsTest::testDefaultTab in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php \Drupal\Tests\system\Functional\Form\ElementsVerticalTabsTest::testDefaultTab()

Ensures that default vertical tab is correctly selected.

File

core/modules/system/tests/src/Functional/Form/ElementsVerticalTabsTest.php, line 84

Class

ElementsVerticalTabsTest
Tests the vertical_tabs form element for expected behavior.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testDefaultTab() {
  $this
    ->drupalGet('form_test/vertical-tabs');
  $value = $this
    ->assertSession()
    ->elementExists('css', 'input[name="vertical_tabs__active_tab"]')
    ->getValue();
  $this
    ->assertSame('edit-tab3', $value, t('The default vertical tab is correctly selected.'));
}