You are here

public function FieldGroupUiTest::setUp in Field Group 8

Same name and namespace in other branches
  1. 8.3 tests/src/FunctionalJavascript/FieldGroupUiTest.php \Drupal\Tests\field_group\FunctionalJavascript\FieldGroupUiTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/FieldGroupUiTest.php, line 32

Class

FieldGroupUiTest
Test field_group user interface.

Namespace

Drupal\Tests\field_group\FunctionalJavascript

Code

public function setUp() {
  parent::setUp();

  // Create test user.
  $admin_user = $this
    ->drupalCreateUser([
    'access content',
    'administer content types',
    'administer node fields',
    'administer node form display',
    'administer node display',
    'bypass node access',
  ]);
  $this
    ->drupalLogin($admin_user);

  // Create content type, with underscores.
  $type_name = Unicode::strtolower($this
    ->randomMachineName(8)) . '_test';
  $type = NodeType::create([
    'name' => $type_name,
    'type' => $type_name,
  ]);
  $type
    ->save();
  $this->nodeType = $type
    ->id();
}