You are here

protected function LinkItemNormalizerTest::setUp in Replication 8

Overrides NormalizerTestBase::setUp

File

tests/src/Kernel/Normalizer/LinkItemNormalizerTest.php, line 27

Class

LinkItemNormalizerTest
Tests the link serialization format.

Namespace

Drupal\Tests\replication\Kernel\Normalizer

Code

protected function setUp() {
  parent::setUp();
  $this->user = $this
    ->createUser();
  $this
    ->setCurrentUser($this->user);

  // Create a Link field for testing.
  FieldStorageConfig::create([
    'field_name' => 'field_test_link',
    'entity_type' => 'entity_test_mulrev',
    'type' => 'link',
    'cardinality' => 2,
    'translatable' => FALSE,
  ])
    ->save();
  FieldConfig::create([
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_link',
    'bundle' => 'entity_test_mulrev',
    'label' => 'Test link-field',
    'widget' => [
      'type' => 'link',
      'weight' => 0,
    ],
  ])
    ->save();
}