function RelationshipNodeFileDataTest::setUp

Same name in other branches
  1. 10 core/modules/file/tests/src/Kernel/Views/RelationshipNodeFileDataTest.php \Drupal\Tests\file\Kernel\Views\RelationshipNodeFileDataTest::setUp()

Overrides ViewsKernelTestBase::setUp

File

core/modules/file/tests/src/Kernel/Views/RelationshipNodeFileDataTest.php, line 39

Class

RelationshipNodeFileDataTest
Tests file on node 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('node');
    $this->installEntitySchema('file');
    $this->installEntitySchema('user');
    $this->installConfig([
        'node',
        'field',
        'file_test_views',
    ]);
    // Create the node file field and instance.
    FieldStorageConfig::create([
        'entity_type' => 'node',
        'field_name' => 'node_file',
        'type' => 'file',
        'translatable' => '0',
    ])->save();
    FieldConfig::create([
        'label' => 'Node File',
        'description' => '',
        'field_name' => 'node_file',
        'entity_type' => 'node',
        'bundle' => 'file_test',
        '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.