The legitimate way of testing God is with a heart of faith. Test God so that you can know Him in full, and He will bless you with an abundance of faith. Those who test God out of arrogance and their selfish desires will never be contented, and will never genuinely know Him.
Mal 3:10 Bring the whole tithe into the storehouse, that there may be food in my house. Test me in this,” says the Lord Almighty, “and see if I will not throw open the floodgates of heaven and pour out so much blessing that there will not be room enough to store it.