It is so funny you brought up this topic. I have been discussing this with my husband recently. I made the decision to read the different holy texts and to see what they actually say and not add outside interpretation. So this is what I am thinking about at this point. It says there was a tree of knowledge of 'good and bad'. The term 'of good and bad' could also mean 'everything'. There was also a tree of life.
The bible does not say it was there as a test for mankind just that they were there. What we know is that it is stated that after eating from the tree they did understand things they didn't understand before. The human brain has a physical learning process. It is able to progress in learning when the synapses myelinate and cannot progress until that happens.
What if it was always the intention of God to have Adam and Eve eat from the tree when they had matured enough. We know that God said that man was good not perfect( or complete) when he was created. It may have been (my own idea) that the eating of the tree caused an premature myelinating that they were not ready for and that this would cause problems. Like a three year old cooking on a stove or a five year old driving. If this were the case there would be a reason for the tree and it would explain the physical reaction to eating from it. It could also fit with the description God gave of the results of this premature knowledge. Also it was stated that if Adam and Eve ate from the tree of life they would continue to live. God may have known that they the way had physically altered themselves would become genetic and would only lead to problems that would need to be addressed.