public function EntitySerializationTest::testDenormalizeSerializedItem in Drupal 10
Same name and namespace in other branches
- 8 core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php \Drupal\Tests\serialization\Kernel\EntitySerializationTest::testDenormalizeSerializedItem()
- 9 core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php \Drupal\Tests\serialization\Kernel\EntitySerializationTest::testDenormalizeSerializedItem()
Tests denormalizing serialized columns.
File
- core/
modules/ serialization/ tests/ src/ Kernel/ EntitySerializationTest.php, line 283
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);
}