function OptionsFieldUITest::setUp

Same name in other branches
  1. 9 core/modules/options/tests/src/Functional/OptionsFieldUITest.php \Drupal\Tests\options\Functional\OptionsFieldUITest::setUp()
  2. 10 core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php \Drupal\Tests\options\FunctionalJavascript\OptionsFieldUITest::setUp()
  3. 10 core/modules/options/tests/src/Functional/OptionsFieldUITest.php \Drupal\Tests\options\Functional\OptionsFieldUITest::setUp()
  4. 11.x core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUITest.php \Drupal\Tests\options\FunctionalJavascript\OptionsFieldUITest::setUp()
  5. 11.x core/modules/options/tests/src/Functional/OptionsFieldUITest.php \Drupal\Tests\options\Functional\OptionsFieldUITest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/options/tests/src/Functional/OptionsFieldUITest.php, line 63

Class

OptionsFieldUITest
Tests the Options field UI functionality.

Namespace

Drupal\Tests\options\Functional

Code

protected function setUp() {
    parent::setUp();
    // Create test user.
    $admin_user = $this->drupalCreateUser([
        'access content',
        'administer taxonomy',
        'access administration pages',
        'administer site configuration',
        'administer content types',
        'administer nodes',
        'bypass node access',
        'administer node fields',
        'administer node display',
    ]);
    $this->drupalLogin($admin_user);
    // Create content type, with underscores.
    $this->typeName = 'test_' . strtolower($this->randomMachineName());
    $type = $this->drupalCreateContentType([
        'name' => $this->typeName,
        'type' => $this->typeName,
    ]);
    $this->type = $type->id();
}

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