function EntityReferenceSelectionAccessTest::setUp

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php \Drupal\Tests\system\Functional\Entity\EntityReferenceSelection\EntityReferenceSelectionAccessTest::setUp()
  2. 10 core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php \Drupal\Tests\system\Kernel\Entity\EntityReferenceSelection\EntityReferenceSelectionAccessTest::setUp()
  3. 11.x core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php \Drupal\Tests\system\Kernel\Entity\EntityReferenceSelection\EntityReferenceSelectionAccessTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php, line 55

Class

EntityReferenceSelectionAccessTest
Tests for the base handlers provided by Entity Reference.

Namespace

Drupal\Tests\system\Functional\Entity\EntityReferenceSelection

Code

protected function setUp() : void {
    parent::setUp();
    $this->installSchema('system', 'sequences');
    $this->installSchema('comment', [
        'comment_entity_statistics',
    ]);
    $this->installSchema('file', [
        'file_usage',
    ]);
    $this->installEntitySchema('comment');
    $this->installEntitySchema('file');
    $this->installEntitySchema('media');
    $this->installEntitySchema('node');
    $this->installEntitySchema('taxonomy_term');
    $this->installEntitySchema('user');
    $this->installConfig([
        'comment',
        'field',
        'media',
        'node',
        'taxonomy',
        'user',
    ]);
    // Create the anonymous and the admin users.
    $anonymous_user = User::create([
        'uid' => 0,
        'name' => '',
    ]);
    $anonymous_user->save();
    $admin_user = User::create([
        'uid' => 1,
        'name' => 'admin',
        'status' => 1,
    ]);
    $admin_user->save();
}

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