You are here

protected function LinkItemSerializationTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php \Drupal\Tests\link\Kernel\LinkItemSerializationTest::setUp()

Set the default field storage backend for fields created during tests.

Overrides FieldKernelTestBase::setUp

File

core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php, line 34

Class

LinkItemSerializationTest
Tests link field serialization.

Namespace

Drupal\Tests\link\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installEntitySchema('user');
  $this->serializer = \Drupal::service('serializer');

  // Create a generic, external, and internal link fields for validation.
  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' => [
      'link_type' => LinkItemInterface::LINK_GENERIC,
    ],
  ])
    ->save();
}