function ViewsConfigUpdaterTest::setUp

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php \Drupal\Tests\views\Kernel\ViewsConfigUpdaterTest::setUp()

Overrides ViewsKernelTestBase::setUp

File

core/modules/views/tests/src/Kernel/ViewsConfigUpdaterTest.php, line 38

Class

ViewsConfigUpdaterTest
@coversDefaultClass \Drupal\views\ViewsConfigUpdater

Namespace

Drupal\Tests\views\Kernel

Code

protected function setUp($import_test_views = TRUE) : void {
    parent::setUp();
    $this->configUpdater = $this->container
        ->get('class_resolver')
        ->getInstanceFromDefinition(ViewsConfigUpdater::class);
    FieldStorageConfig::create([
        'field_name' => 'user_picture',
        'entity_type' => 'user',
        'type' => 'image',
    ])->save();
    FieldConfig::create([
        'entity_type' => 'user',
        'field_name' => 'user_picture',
        'file_directory' => 'pictures/[date:custom:Y]-[date:custom:m]',
        'bundle' => 'user',
    ])->save();
}

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