function EntitySerializationTest::testDenormalizeSerializedItem
Tests denormalizing serialized columns.
File
- 
              core/modules/ serialization/ tests/ src/ Kernel/ EntitySerializationTest.php, line 287 
Class
- EntitySerializationTest
- Tests that entities can be serialized to supported core formats.
Namespace
Drupal\Tests\serialization\KernelCode
public function testDenormalizeSerializedItem() {
  $this->expectException(\LogicException::class);
  $this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "value" properties of the "serialized" field (field item class: Drupal\\entity_test\\Plugin\\Field\\FieldType\\SerializedItem).');
  $this->serializer
    ->denormalize([
    'serialized' => [
      [
        'value' => 'boo',
      ],
    ],
    'type' => 'entity_test_serialized_field',
  ], EntitySerializedField::class);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
