function MultipleWidgetFormTest::setUp

Same name in other branches
  1. 10 core/modules/field/tests/src/Functional/MultipleWidgetFormTest.php \Drupal\Tests\field\Functional\MultipleWidgetFormTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/field/tests/src/Functional/MultipleWidgetFormTest.php, line 57

Class

MultipleWidgetFormTest
Tests field form handling.

Namespace

Drupal\Tests\field\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $web_user = $this->drupalCreateUser([
        'view test entity',
        'administer entity_test content',
        'administer entity_test fields',
    ]);
    $this->drupalLogin($web_user);
    $this->fieldStorageMultiple = [
        'field_name' => 'field_multiple',
        'entity_type' => 'entity_test',
        'type' => 'test_field',
        'cardinality' => 4,
    ];
    $this->field = [
        'entity_type' => 'entity_test',
        'bundle' => 'entity_test',
        'label' => $this->randomMachineName() . '_label',
        'description' => '[site:name]_description',
        'weight' => mt_rand(0, 127),
        'settings' => [
            'test_field_setting' => $this->randomMachineName(),
        ],
    ];
}

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