Did God plant the tree simply to test His human creation? No, God's Creation was not put into place as a test. God created and "it was good". The tree was in the Garden because it needed to be there. Because it was God's paradise and God's paradise contained all Truth, and the seeds of Truth. And Truth would include this knowledge, the knowledge of good and evil.
There is another tree in the Garden. The Tree of Life. When God drove the disobedient from the Garden, His statement seems one of alarm: “’And he said: Behold Adam is become as one of us, knowing good and evil: now, therefore, lest perhaps he put forth his hand, and take also of the tree of life, and eat, and live for ever. And the Lord God sent him out of the paradise of pleasure, to till the earth from which he was taken.” [Genesis 3:22-23]
So what is the fruit of the Tree of Knowledge of Good and Evil? Did Adam and Eve gain a sudden explosion of knowledge of all the implications of good and evil actions? We're not told they did, but they received an incipient version of it. "And the eyes of them both were opened: and when they perceived themselves to be naked, they sewed together fig leaves, and made themselves aprons." [Gen. 3:7] A strange and terrible moment from such a small thing. A bite of fruit. A disobedient act. A feeling of shame. That was the eye-opening. But it was just the beginning.
The rest of the collection of books we call the Bible deals with the consequences of this disobedience. The fruit of the tree, eaten by our first parents, is the seed which bears the fullness of its fruit later on. This is not a single act with a single consequence. Jesus speaks parables where He likens the Kingdom of Heaven to seed sown in a field. He says the field where the seed is sown is the hearer of the Gospel. It's us. People. It's also collective, a field is planted with wheat and an enemy comes in at night and sows cockle ("tares" as we commonly hear from readers of the KJV). We are told that we, the children of Adam and Eve, inherit their original sin. "Wherefore as by one man sin entered into this world, and by sin death; and so death passed upon all men, in whom all have sinned." [Romans 5:12] So the bite of fruit brought something into our human nature. It bore its fruit and we see it in the pages of the Pentateuch, the Five Books of Moses. It's central to the narrative of the Israelites and figures prominently in the passion and death of our Lord. The answer to the question, what is the fruit of this tree, is plain when we look again at its name. The Tree of Knowledge of Good and Evil. How do we learn this kind of knowledge? As individuals, we learn it through experience, through the discipline of our parents, through education, through learning the laws of the state. The narrative of the Hebrews begins in detail with the story of the life of Abraham. It continues with Isaac, and Jacob, and the sons of Jacob, particularly Joseph, whose ordeal causes the families of all his brothers and sister to come into Egypt. In Egypt, they go from being honored guests to becoming slaves. As God had said, "And to Adam he said: Because thou hast hearkened to the voice of thy wife, and hast eaten of the tree, whereof I commanded thee that thou shouldst not eat, cursed is the earth in thy work; with labour and toil shalt thou eat thereof all the days of thy life. Thorns and thistles shall it bring forth to thee; and thou shalt eat the herbs of the earth. In the sweat of thy face shalt thou eat bread till thou return to the earth, out of which thou wast taken: for dust thou art, and into dust thou shalt return." [Gen. 3:17-19] This condemnation was brought fully home to the children of Abraham when they were made to labor and toil as slaves in Egypt for generations. When it came time to leave their life of bondage, they ate of the Paschal lamb (Communion), they crossed through the sea (Baptism), they went to the mountain of God in Arabia and Moses went up and there he received the fruit of the eating of the Tree of Knowledge of Good and Evil. That fruit was the Law. In the Law given to Moses, God tells the children of Adam and Eve what is good and what is evil. This is the continuity of the Biblical narrative.
Because by the works of the law no flesh shall be justified before him. For by the law is the knowledge of sin. [Romans 3:20]
This was not a light gift that God gave. It was a heavy burden to bear. The consequences of disobedience remain death. The Law prescribed punishments- stoning and ostracism, and more than that for collective disobedience- drought, war, diaspora. To live up to the Law, the priests of the tribe of Levi needed to undergo purifications, ritual cleansing, perform the blood-sacrifice of animals, and worship in the Tabernacle and then the Temple. The worship went on for centuries, as the children of Israel continued in their ways both good and evil, worshiping God but also the Canaanite idols, castigated by God’s prophets, driven into Assyria and Babylon, overtaken by the Greeks and the Romans.
Here in the Law we have the elder brother. The elder brother never gets a good deal in Genesis. The elder brothers were Cain, Ishmael, Esau, Reuben, who slept with his father's concubine, and of whom Jacob/Israel said on his deathbed, "Thou art poured out as water, grow thou not: because thou wentest up to thy father' s bed, and didst defile his couch." [Gen. 49:4] The elder brother is the son of the bondwoman, as St. Paul writes in his epistle to the Galatians:
Tell me, you that desire to be under the law, have you not read the law? For it is written that Abraham had two sons: the one by a bondwoman, and the other by a free woman. But he who was of the bondwoman, was born according to the flesh: but he of the free woman, was by promise. Which things are said by an allegory. For these are the two testaments. The one from mount Sina, engendering unto bondage; which is Agar: For Sina is a mountain in Arabia, which hath affinity to that Jerusalem which now is, and is in bondage with her children. [Galatians 4:21-25]
So Christ, the Son of the free woman (Mary), the figuratively younger brother of Adam (in His human nature He was born later), overcame the Law by fulfilling it. By drinking the cup of the wine of the Law, the full fruit of the Knowledge of Good and Evil, to its dregs, He took on Himself all the consequences of disobedience to the Law of God His Father, and by uniting ourselves to Him through Holy Communion we are able to join with Him in His triumph.