Erickson writes in his What Does God Know and When Does He Know It concerning Genesis 22:
Note, however, exactly what is said here. God does not say, “Now I know what you would do in such a situation.” Rather, he says, “Now I know that you fear me.” While this may seem to be a small matter of difference, it will be worth bearing in mind. Apparently, Jehovah did not simply not know what Abraham would do. If one interprets this text in a literal fashion, then one has also established that, at least in this case, Jehovah did not really know the heart of the person involved. The problem comes from the fact that the open theists believe that God knows persons completely, all of the personality and character of each person, all of the thoughts of the heart. It is only on this basis that God is able to make the predictions he does of what persons will do.
Erickson, Millard J. (2009-08-30). What Does God Know and When Does He Know It?: The Current Controversy over Divine Foreknowledge (pp. 24-25). Zondervan. Kindle Edition.
Erickson’s objection is a strange objection. Imagine a wife enlists one of her friend’s help in a plan to test her husband’s faithfulness. She has her friend proposition her husband in an intimate situation. Say that the husband passes the test. What is his wife to proclaim: “Now I know that you are faithful” or “Now I know what you will do in such a situation”? Erickson posits an entirely unrealistic narrative that the text would have to follow in order to be an Open Theist text.
But real life does not work the way Erickson posits. We test to gain general knowledge, not to gain knowledge of the specific. Gaining knowledge of the specific would completely defeat the entire point of the text! What good is a test whose results cannot be generalized to other areas? What was the purpose, then, of the test? To figure out within very narrow parameters how Abraham would act? That is not how character tests work.
Erikson’s second problem comes when he assumes the heart is knowable. He envisions the heart like a computer hard drive, all the coding is intact and various scenarios can be run with predictable results (that is, if one has access to the code). There is no indication this is a Biblical concept, and it entirely violates the natural Biblical assumption of free will. God often laments about His failed attempts to sway the people to Himself. Hearts do not work like input-output devices. Instead, knowledge of the heart is gained through testing. See how people respond to tests and then general trends can be known. Throughout the Bible, it explicitly states that God tests to know.