I am creating a test method to test functionality allowing users to search for other users.
In order to do this, I have tried creating and saving test users with certain criteria, and then searching for those users with a SOQL select. However, when I try to search for those test users, I cannot find them - I only find "real" users that exist outside the test. I assume that this is because "real" users are available to testmethods.
If I cannot rely on "real" users to be consistent between environments, and I cannot create and insert a user within the test, I have no idea how to test this functionality. Is there a way to access users you create & insert within a test method?