function RelationshipUserImageDataTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php \Drupal\Tests\image\Kernel\Views\RelationshipUserImageDataTest::setUp()
  2. 8.9.x core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php \Drupal\Tests\image\Kernel\Views\RelationshipUserImageDataTest::setUp()
  3. 10 core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php \Drupal\Tests\image\Kernel\Views\RelationshipUserImageDataTest::setUp()

Overrides ViewsKernelTestBase::setUp

File

core/modules/image/tests/src/Kernel/Views/RelationshipUserImageDataTest.php, line 46

Class

RelationshipUserImageDataTest
Tests image on user relationship handler.

Namespace

Drupal\Tests\image\Kernel\Views

Code

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

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