function EntityReferenceFieldDefaultValueTest::setUp

Same name in other branches
  1. 9 core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php \Drupal\Tests\field\Functional\EntityReference\EntityReferenceFieldDefaultValueTest::setUp()
  2. 10 core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php \Drupal\Tests\field\Functional\EntityReference\EntityReferenceFieldDefaultValueTest::setUp()
  3. 11.x core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php \Drupal\Tests\field\Functional\EntityReference\EntityReferenceFieldDefaultValueTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php, line 39

Class

EntityReferenceFieldDefaultValueTest
Tests entity reference field default values storage in CMI.

Namespace

Drupal\Tests\field\Functional\EntityReference

Code

protected function setUp() {
    parent::setUp();
    // Create default content type.
    $this->drupalCreateContentType([
        'type' => 'reference_content',
    ]);
    $this->drupalCreateContentType([
        'type' => 'referenced_content',
    ]);
    // Create admin user.
    $this->adminUser = $this->drupalCreateUser([
        'access content',
        'administer content types',
        'administer node fields',
        'administer node form display',
        'bypass node access',
    ]);
    $this->drupalLogin($this->adminUser);
}

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