function LinkItemSerializationTest::setUp
Same name in other branches
- 9 core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php \Drupal\Tests\link\Kernel\LinkItemSerializationTest::setUp()
- 10 core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php \Drupal\Tests\link\Kernel\LinkItemSerializationTest::setUp()
- 11.x core/modules/link/tests/src/Kernel/LinkItemSerializationTest.php \Drupal\Tests\link\Kernel\LinkItemSerializationTest::setUp()
Overrides FieldKernelTestBase::setUp
File
-
core/
modules/ link/ tests/ src/ Kernel/ LinkItemSerializationTest.php, line 34
Class
- LinkItemSerializationTest
- Tests link field serialization.
Namespace
Drupal\Tests\link\KernelCode
protected function setUp() {
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();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.