You are here

public function EntitySerializationTest::testDenormalizeSerializedItem in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php \Drupal\Tests\serialization\Kernel\EntitySerializationTest::testDenormalizeSerializedItem()
  2. 10 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 275

Class

EntitySerializationTest
Tests that entities can be serialized to supported core formats.

Namespace

Drupal\Tests\serialization\Kernel

Code

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);
}