function FieldAccessTest::setUp

Same name in this branch
  1. 11.x core/modules/field/tests/src/Functional/FieldAccessTest.php \Drupal\Tests\field\Functional\FieldAccessTest::setUp()
Same name in other branches
  1. 9 core/modules/field/tests/src/Functional/FieldAccessTest.php \Drupal\Tests\field\Functional\FieldAccessTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php \Drupal\KernelTests\Core\Field\FieldAccessTest::setUp()
  3. 8.9.x core/modules/field/tests/src/Functional/FieldAccessTest.php \Drupal\Tests\field\Functional\FieldAccessTest::setUp()
  4. 8.9.x core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php \Drupal\KernelTests\Core\Field\FieldAccessTest::setUp()
  5. 10 core/modules/field/tests/src/Functional/FieldAccessTest.php \Drupal\Tests\field\Functional\FieldAccessTest::setUp()
  6. 10 core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php \Drupal\KernelTests\Core\Field\FieldAccessTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php, line 46

Class

FieldAccessTest
Tests Field level access hooks.

Namespace

Drupal\KernelTests\Core\Field

Code

protected function setUp() : void {
    parent::setUp();
    // Install field configuration.
    $this->installConfig([
        'field',
    ]);
    $this->installEntitySchema('entity_test');
    $this->installEntitySchema('entity_test_mul');
    $this->installEntitySchema('entity_test_mul_langcode_key');
    $this->installEntitySchema('entity_test_mul_changed');
    $this->installEntitySchema('entity_test_rev');
    $this->installEntitySchema('entity_test_mulrev');
    $this->installEntitySchema('entity_test_mulrev_changed');
    // The users table is needed for creating dummy user accounts.
    $this->installEntitySchema('user');
    // Register entity_test text field.
    $this->container
        ->get('module_handler')
        ->loadInclude('entity_test', 'install');
    entity_test_install();
}

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