function LinkFormatterDisplayTest::setUp
Set the default field storage backend for fields created during tests.
Overrides FieldKernelTestBase::setUp
File
- 
              core/
modules/ link/ tests/ src/ Kernel/ LinkFormatterDisplayTest.php, line 38  
Class
- LinkFormatterDisplayTest
 - Tests the default 'link' field formatter.
 
Namespace
Drupal\Tests\link\KernelCode
protected function setUp() : void {
  parent::setUp();
  FieldStorageConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => 'field_test',
    'type' => 'link',
  ])->save();
  FieldConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => 'field_test',
    'bundle' => 'entity_test',
    'settings' => [
      'title' => LinkTitleVisibility::Optional->value,
      'link_type' => LinkItemInterface::LINK_GENERIC,
    ],
  ])
    ->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.