In line with the Qur'anQur'an 7:155 ↗وَٱخۡتَارَ مُوسَىٰ قَوۡمَهُۥ سَبۡعِينَ رَجُلٗا لِّمِيقَٰتِنَاۖ فَلَمَّآ أَخَذَتۡهُمُ ٱلرَّجۡفَةُ قَالَ رَبِّ لَوۡ شِئۡتَ أَهۡلَكۡتَهُم مِّن قَبۡلُ وَإِيَّٰيَۖ أَتُهۡلِكُنَا بِمَا فَعَلَ ٱلسُّفَهَآءُ مِنَّآۖ إِنۡ هِيَ إِلَّا فِتۡنَتُكَ تُضِلُّ بِهَا مَن تَشَآءُ وَتَهۡدِي مَن تَشَآءُۖ أَنتَ وَلِيُّنَا فَٱغۡفِرۡ لَنَا وَٱرۡحَمۡنَاۖ وَأَنتَ خَيۡرُ ٱلۡغَٰفِرِينَ
And Moses chose from his people seventy men for Our appointment. When the tremor shook them, he said, “My Lord, had You willed, You could have destroyed them before, and me too. Will you destroy us for what the fools among us have done? This is but Your test—with it You misguide whomever You will, and guide whomever You will. You are our Protector, so forgive us, and have mercy on us. You are the Best of Forgivers.”
The verse says it is God's trial by which He leads astray whom He wills and guides whom He wills, matching 'God is the guide and the one who tests'.
In line with the Qur'anQur'an 21:35 ↗كُلُّ نَفۡسٖ ذَآئِقَةُ ٱلۡمَوۡتِۗ وَنَبۡلُوكُم بِٱلشَّرِّ وَٱلۡخَيۡرِ فِتۡنَةٗۖ وَإِلَيۡنَا تُرۡجَعُونَ
Every soul will taste death. We burden you with adversity and prosperity—a test. And to Us you will be returned.
The verse says God tests people with evil and good as a trial, matching God as the one who tests.