diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceItemTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceItemTest.php index c47a84a..d7b7980 100644 --- a/core/modules/field/src/Tests/EntityReference/EntityReferenceItemTest.php +++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceItemTest.php @@ -266,6 +266,12 @@ public function testEntitySaveOrder() { $entity->field_test_taxonomy_term->entity = $term; $entity->name->value = $this->randomMachineName(); // Now save the term. + // Now get the field value. + $value = $entity->get('field_test_taxonomy_term'); + $this->assertTrue(empty($value['target_id'])); + $this->assertNull($entity->field_test_taxonomy_term->target_id); + // And then set it. + $entity->field_test_taxonomy_term = $value; $term->save(); // And then the entity. $entity->save();