You are here

protected function RelationshipUserFileDataTest::setUp in Drupal 8

Overrides ViewTestBase::setUp

File

core/modules/file/tests/src/Functional/Views/RelationshipUserFileDataTest.php, line 38

Class

RelationshipUserFileDataTest
Tests file on user relationship handler.

Namespace

Drupal\Tests\file\Functional\Views

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);

  // 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(get_class($this), [
    'file_test_views',
  ]);
}