diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php index 0a8fe938d7..a107250865 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php @@ -4,6 +4,8 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Field\FieldDefinitionInterface; +use Drupal\Core\TypedData\Plugin\DataType\StringData; +use Drupal\Core\TypedData\Type\StringInterface; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Entity\FieldableEntityInterface; @@ -122,8 +124,8 @@ public function testNormalize() { ->willReturn($entity_reference) ->shouldBeCalled(); - $this->fieldItem->getProperties(TRUE) - ->willReturn([]) + $this->fieldItem->getExposedProperties() + ->willReturn(['target_id' => NULL]) ->shouldBeCalled(); $normalized = $this->normalizer->normalize($this->fieldItem->reveal()); @@ -150,8 +152,8 @@ public function testNormalizeWithNoEntity() { ->willReturn($entity_reference->reveal()) ->shouldBeCalled(); - $this->fieldItem->getProperties(TRUE) - ->willReturn([]) + $this->fieldItem->getExposedProperties() + ->willReturn(['target_id' => NULL]) ->shouldBeCalled(); $normalized = $this->normalizer->normalize($this->fieldItem->reveal());