function ManageDisplayTest::testViewModeLocalTasksOrder

Same name in other branches
  1. 10 core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php \Drupal\Tests\field_ui\Functional\ManageDisplayTest::testViewModeLocalTasksOrder()

Tests if display mode local tasks appear in alphabetical order by label.

File

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

Class

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

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testViewModeLocalTasksOrder() : void {
    $manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
    // Specify the 'rss' mode, check that the field is displayed the same.
    $edit = [
        'display_modes_custom[rss]' => TRUE,
        'display_modes_custom[teaser]' => TRUE,
    ];
    $this->drupalGet($manage_display);
    $this->submitForm($edit, 'Save');
    $this->assertOrderInPage([
        'RSS',
        'Teaser',
    ]);
    $edit = [
        'label' => 'Breezier',
    ];
    $this->drupalGet('admin/structure/display-modes/view/manage/node.teaser');
    $this->submitForm($edit, 'Save');
    $this->assertOrderInPage([
        'Breezier',
        'RSS',
    ]);
}

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