.../tests/src/Kernel/FieldItemSerializationTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php index 36843f1..40b25fa 100644 --- a/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/FieldItemSerializationTest.php @@ -173,9 +173,13 @@ public function testCustomBooleanNormalization(array $test_modules, $format) { $this->assertSame(TRUE, $denormalized_entity->field_test_boolean->value); }; - // Asserts denormalizing the entity DOES yield the value we set. + // Asserts denormalizing the entity DOES yield the value we set: + // - when using the detailed representation $core_normalization['field_test_boolean'][0]['value'] = TRUE; $assert_denormalization($core_normalization); + // - and when using the shorthand representation + $core_normalization['field_test_boolean'][0] = TRUE; + $assert_denormalization($core_normalization); // Install test module that contains a high-priority alternative normalizer. $this->enableModules($test_modules); @@ -184,9 +188,13 @@ public function testCustomBooleanNormalization(array $test_modules, $format) { $core_normalization = $this->container->get('serializer')->normalize($this->entity, $format); $this->assertSame('👎', $core_normalization['field_test_boolean'][0]['value']); - // Asserts denormalizing the entity DOES NOT ANYMORE yield the value we set. + // Asserts denormalizing the entity DOES NOT ANYMORE yield the value we set: + // - when using the detailed representation $core_normalization['field_test_boolean'][0]['value'] = '👍'; $assert_denormalization($core_normalization); + // - and when using the shorthand representation + $core_normalization['field_test_boolean'][0] = '👍'; + $assert_denormalization($core_normalization); } /**