protected function RelationshipUserFileDataTest::setUp in Drupal 9
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\ViewsCode
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',
]);
}