8 – Establish reference field value of entity reference?

How do I set the entity reference revision value for a field? I have two fields, field_test_entity_reference and field_test_entity_revision. field_test_entity_reference is a reference of entity of type of field and field_test_entity_revision is of revision of reference of entity of type. Both refer to the same type of content. I have created a node of this type of content and its id is 7747. I am testing the following code and set the value correctly for the field that is of entity type reference but not for the entity revision version.

$ node-field_test_entity_reference-> target_id = 7747;
$ node-field_test_entity_revision-> target_id = 7747;
$ node-> save ();