"When Jesus then lifted up [His] eyes, and saw a great company come unto Him, He saith unto Philip, Whence shall we buy bread, that these may eat? And this He said to prove him: for He Himself knew what He would do." (John 6:5-6)In our society, we are familiar with tests. Standardized tests; SAT/ACT, tests for public school performance; tests in class; driving tests; eye tests.
In these cases, the test is used to verify reality for the test maker. That is, do we meet the standard of the college, or the department of education, motor vehicles, etc.
But that is not why God tests us.
God already knows what we have done, why, and what we will do. He has no need to prove things to Himself.
God gives us tests to reveal our performance to ourselves.