function RelationshipUserFileDataTest::setUp

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

Overrides ViewsKernelTestBase::setUp

File

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

Class

RelationshipUserFileDataTest
Tests file on user relationship handler.

Namespace

Drupal\Tests\file\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) : void {
    parent::setUp($import_test_views);
    $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',
    ]);
    $this->installConfig([
        'field',
        'file_test_views',
    ]);
}

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