function RelationshipUserFileDataTest::setUp

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

Overrides KernelTestBase::setUp

File

core/modules/file/tests/src/Kernel/Views/RelationshipUserFileDataTest.php, line 46

Class

RelationshipUserFileDataTest
Tests file on user relationship handler.

Namespace

Drupal\Tests\file\Kernel\Views

Code

protected function setUp() : void {
    parent::setUp();
    $this->installSchema('system', [
        'sequences',
    ]);
    $this->installSchema('file', [
        'file_usage',
    ]);
    $this->installEntitySchema('user');
    $this->installEntitySchema('file');
    // Create the user profile field and instance.
    FieldStorageConfig::create([
        'entity_type' => 'user',
        'field_name' => 'user_file',
        'type' => 'file',
        'translatable' => '0',
    ])->save();
    FieldConfig::create([
        'label' => 'User File',
        'description' => '',
        'field_name' => 'user_file',
        'entity_type' => 'user',
        'bundle' => 'user',
        'required' => 0,
    ])->save();
    ViewTestData::createTestViews(static::class, [
        'file_test_views',
    ]);
}

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