function FieldLayoutTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php, line 35

Class

FieldLayoutTest
Tests using field layout for entity displays.

Namespace

Drupal\Tests\field_layout\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();
  $entity = EntityTest::create([
    'name' => 'The name for this entity',
    'field_test_text' => [
      [
        'value' => 'The field test text value',
      ],
    ],
  ]);
  $entity->save();
  $this->drupalLogin($this->drupalCreateUser([
    'access administration pages',
    'view test entity',
    'administer entity_test content',
    'administer entity_test fields',
    'administer entity_test display',
    'administer entity_test form display',
    'view the administration theme',
  ]));
}

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