diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php index e9df564c5fd58f47bc04246916e8745429f9597a..5cc6467e8b6e2d3714ea79bf45ea4c63a4986186 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php @@ -70,7 +70,7 @@ protected function setUp() { $this->serializer = $this->prophesize(Serializer::class); // Set up the serializer to return an entity property. $this->serializer->normalize(Argument::cetera()) - ->willReturn(['value' => 'test']); + ->willReturn('test'); $this->normalizer->setSerializer($this->serializer->reveal()); @@ -131,7 +131,7 @@ public function testNormalize() { $normalized = $this->normalizer->normalize($this->fieldItem->reveal()); $expected = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_type' => 'test_type', 'target_uuid' => '080e3add-f9d5-41ac-9821-eea55b7b42fb', 'url' => $test_url, @@ -159,7 +159,7 @@ public function testNormalizeWithNoEntity() { $normalized = $this->normalizer->normalize($this->fieldItem->reveal()); $expected = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', ]; $this->assertSame($expected, $normalized); } @@ -169,7 +169,7 @@ public function testNormalizeWithNoEntity() { */ public function testDenormalizeWithTypeAndUuid() { $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_type' => 'test_type', 'target_uuid' => '080e3add-f9d5-41ac-9821-eea55b7b42fb', ]; @@ -193,7 +193,7 @@ public function testDenormalizeWithTypeAndUuid() { */ public function testDenormalizeWithUuidWithoutType() { $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_uuid' => '080e3add-f9d5-41ac-9821-eea55b7b42fb', ]; @@ -218,7 +218,7 @@ public function testDenormalizeWithUuidWithIncorrectType() { $this->setExpectedException(UnexpectedValueException::class, 'The field "field_reference" property "target_type" must be set to "test_type" or omitted.'); $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_type' => 'wrong_type', 'target_uuid' => '080e3add-f9d5-41ac-9821-eea55b7b42fb', ]; @@ -238,7 +238,7 @@ public function testDenormalizeWithTypeWithIncorrectUuid() { $this->setExpectedException(InvalidArgumentException::class, 'No "test_type" entity found with UUID "unique-but-none-non-existent" for field "field_reference"'); $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_type' => 'test_type', 'target_uuid' => 'unique-but-none-non-existent', ]; @@ -261,7 +261,7 @@ public function testDenormalizeWithEmtpyUuid() { $this->setExpectedException(InvalidArgumentException::class, 'If provided "target_uuid" cannot be empty for field "test_type".'); $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', 'target_type' => 'test_type', 'target_uuid' => '', ]; @@ -278,7 +278,7 @@ public function testDenormalizeWithEmtpyUuid() { */ public function testDenormalizeWithId() { $data = [ - 'target_id' => ['value' => 'test'], + 'target_id' => 'test', ]; $this->fieldItem->setValue($data)->shouldBeCalled();