public function MapDataNormalizerTest::testMapWithPropertiesNormalize in Drupal 10
Same name and namespace in other branches
- 8 core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php \Drupal\Tests\serialization\Kernel\MapDataNormalizerTest::testMapWithPropertiesNormalize()
- 9 core/modules/serialization/tests/src/Kernel/MapDataNormalizerTest.php \Drupal\Tests\serialization\Kernel\MapDataNormalizerTest::testMapWithPropertiesNormalize()
Tests whether map data with properties can be normalized.
File
- core/
modules/ serialization/ tests/ src/ Kernel/ MapDataNormalizerTest.php, line 64
Class
- MapDataNormalizerTest
- @group typedData
Namespace
Drupal\Tests\serialization\KernelCode
public function testMapWithPropertiesNormalize() {
$typed_data = $this
->buildExampleTypedDataWithProperties();
$data = $this->serializer
->normalize($typed_data, 'json');
$expect_value = [
'key1' => 'value1',
'key2' => 'value2',
'key3' => 3,
'key4' => [
0 => TRUE,
1 => 'value6',
'key7' => 'value7',
],
];
$this
->assertSame($expect_value, $data);
}