diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php
index 0898f48..4baf594 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceItemTest.php
@@ -208,6 +208,10 @@ public function testEntitySaveOrder() {
     $entity->name->value = $this->randomMachineName();
     // Now save the term.
     $term->save();
+    // Now get the field value.
+    $value = $entity->get('field_test_taxonomy_term');
+    // And then set it.
+    $entity->field_test_taxonomy_term = $value;
     // And then the entity.
     $entity->save();
     $this->assertEqual($entity->field_test_taxonomy_term->entity->id(), $term->id());
