function ManageDisplayTest::testFormModeLocalTasksOrder

Same name and namespace in other branches
  1. 11.x core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php \Drupal\Tests\field_ui\Functional\ManageDisplayTest::testFormModeLocalTasksOrder()

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

File

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

Class

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

Namespace

Drupal\Tests\field_ui\Functional

Code

public function testFormModeLocalTasksOrder() : void {
  EntityFormMode::create([
    'id' => 'node.big',
    'label' => 'Big Form',
    'targetEntityType' => 'node',
  ])->save();
  EntityFormMode::create([
    'id' => 'node.little',
    'label' => 'Little Form',
    'targetEntityType' => 'node',
  ])->save();
  $manage_form = 'admin/structure/types/manage/' . $this->type . '/form-display';
  $this->drupalGet($manage_form);
  $this->assertOrderInPage([
    'Big Form',
    'Little Form',
  ]);
  $edit = [
    'label' => 'Ultimate Form',
  ];
  $this->drupalGet('admin/structure/display-modes/form/manage/node.big');
  $this->submitForm($edit, 'Save');
  $this->drupalGet($manage_form);
  $this->assertOrderInPage([
    'Little Form',
    'Ultimate Form',
  ]);
}

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