function NormalizerTestBase::setUp
Same name in this branch
- 9 core/modules/hal/tests/src/Kernel/NormalizerTestBase.php \Drupal\Tests\hal\Kernel\NormalizerTestBase::setUp()
Same name in other branches
- 8.9.x core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php \Drupal\Tests\serialization\Kernel\NormalizerTestBase::setUp()
- 8.9.x core/modules/hal/tests/src/Kernel/NormalizerTestBase.php \Drupal\Tests\hal\Kernel\NormalizerTestBase::setUp()
- 10 core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php \Drupal\Tests\serialization\Kernel\NormalizerTestBase::setUp()
- 11.x core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php \Drupal\Tests\serialization\Kernel\NormalizerTestBase::setUp()
Overrides KernelTestBase::setUp
4 calls to NormalizerTestBase::setUp()
- EntityResolverTest::setUp in core/
modules/ hal/ tests/ src/ Kernel/ EntityResolverTest.php - EntitySerializationTest::setUp in core/
modules/ serialization/ tests/ src/ Kernel/ EntitySerializationTest.php - FieldItemSerializationTest::setUp in core/
modules/ serialization/ tests/ src/ Kernel/ FieldItemSerializationTest.php - FieldItemSerializationTest::setUp in core/
modules/ hal/ tests/ src/ Kernel/ serialization/ FieldItemSerializationTest.php
4 methods override NormalizerTestBase::setUp()
- EntityResolverTest::setUp in core/
modules/ hal/ tests/ src/ Kernel/ EntityResolverTest.php - EntitySerializationTest::setUp in core/
modules/ serialization/ tests/ src/ Kernel/ EntitySerializationTest.php - FieldItemSerializationTest::setUp in core/
modules/ serialization/ tests/ src/ Kernel/ FieldItemSerializationTest.php - FieldItemSerializationTest::setUp in core/
modules/ hal/ tests/ src/ Kernel/ serialization/ FieldItemSerializationTest.php
File
-
core/
modules/ serialization/ tests/ src/ Kernel/ NormalizerTestBase.php, line 32
Class
- NormalizerTestBase
- Helper base class to set up some test fields for serialization testing.
Namespace
Drupal\Tests\serialization\KernelCode
protected function setUp() {
parent::setUp();
$this->installEntitySchema('entity_test_mulrev');
$this->installEntitySchema('user');
$this->installConfig([
'field',
]);
\Drupal::moduleHandler()->invoke('rest', 'install');
// Auto-create a field for testing.
FieldStorageConfig::create([
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_text',
'type' => 'text',
'cardinality' => 1,
'translatable' => FALSE,
])->save();
FieldConfig::create([
'entity_type' => 'entity_test_mulrev',
'field_name' => 'field_test_text',
'bundle' => 'entity_test_mulrev',
'label' => 'Test text-field',
'widget' => [
'type' => 'text_textfield',
'weight' => 0,
],
])->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.