function DisplayModeBundleSelectionTest::setUp

Same name in other branches
  1. 11.x core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php \Drupal\Tests\field_ui\FunctionalJavascript\DisplayModeBundleSelectionTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php, line 34

Class

DisplayModeBundleSelectionTest
Tests the bundle selection for view & form display modes.

Namespace

Drupal\Tests\field_ui\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    $this->drupalCreateContentType([
        'name' => 'Article',
        'type' => 'article',
    ]);
    $this->drupalCreateContentType([
        'name' => 'Page',
        'type' => 'page',
    ]);
    $this->drupalPlaceBlock('local_actions_block');
    $user = $this->drupalCreateUser([
        'administer display modes',
        'administer node display',
        'administer node form display',
    ]);
    // Create a new form mode 'foobar' for content.
    EntityFormMode::create([
        'id' => 'node.foobar',
        'targetEntityType' => 'node',
        'label' => 'Foobar',
    ])->save();
    $this->drupalLogin($user);
}

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