function ManageDisplayTest::testViewModeUi

Tests view mode management screens.

File

core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php, line 208

Class

ManageDisplayTest
Tests the Field UI "Manage display" and "Manage form display" screens.

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testViewModeUi() : void {
    // Tests table headers on "Manage form" and "Manage display" screens.
    $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/overview/form-display');
    $this->assertTableHeaderExistsByLabel('field-display-overview', 'Machine name');
    $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/overview/display');
    $this->assertTableHeaderExistsByLabel('field-display-overview', 'Machine name');
    // Tests hiding the view modes fieldset when there's only one available.
    $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display');
    $this->assertSession()
        ->pageTextNotContains('Use custom display settings for the following view modes');
    // This may not trigger a notice when 'view_modes_custom' isn't available.
    $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/overview/display');
    $this->submitForm([], 'Save');
}

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