function ManageFieldsTest::setUp

Same name in this branch
  1. 10 core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::setUp()
Same name in other branches
  1. 9 core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::setUp()
  2. 8.9.x core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::setUp()
  3. 11.x core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php \Drupal\Tests\field_ui\FunctionalJavascript\ManageFieldsTest::setUp()
  4. 11.x core/modules/field_ui/tests/src/Functional/ManageFieldsTest.php \Drupal\Tests\field_ui\Functional\ManageFieldsTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/field_ui/tests/src/FunctionalJavascript/ManageFieldsTest.php, line 58

Class

ManageFieldsTest
Tests the Field UI "Manage Fields" screens.

Namespace

Drupal\Tests\field_ui\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    $this->drupalPlaceBlock('system_breadcrumb_block');
    $this->drupalPlaceBlock('local_tasks_block');
    $this->drupalPlaceBlock('local_actions_block');
    // Create a test user.
    $admin_user = $this->drupalCreateUser([
        'access content',
        'administer content types',
        'administer node fields',
    ]);
    $this->drupalLogin($admin_user);
    $type = $this->drupalCreateContentType([
        'name' => 'Article',
        'type' => 'article',
    ]);
    $this->type = $type->id();
    $type2 = $this->drupalCreateContentType([
        'name' => 'Basic Page',
        'type' => 'page',
    ]);
    $this->type2 = $type2->id();
    $this->entityTypeManager = $this->container
        ->get('entity_type.manager');
}

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