You are here

protected function MapDataNormalizerTest::buildExampleTypedData in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php \Drupal\Tests\serialization\Kernel\MapDataNormalizerTest::buildExampleTypedData()
  2. 9 core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php \Drupal\Tests\serialization\Kernel\MapDataNormalizerTest::buildExampleTypedData()

Builds some example typed data object with no properties.

File

core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php, line 83

Class

MapDataNormalizerTest
@group typedData

Namespace

Drupal\Tests\serialization\Kernel

Code

protected function buildExampleTypedData() {
  $tree = [
    'key1' => 'value1',
    'key2' => 'value2',
    'key3' => 3,
    'key4' => [
      0 => TRUE,
      1 => 'value6',
      'key7' => 'value7',
    ],
  ];
  $map_data_definition = MapDataDefinition::create();
  $typed_data = $this->typedDataManager
    ->create($map_data_definition, $tree, 'test name');
  return $typed_data;
}