Since you are basically cloning production instance to a test instance, all your users are migrated as well. In the test instance, I would add $CFG->noemailever='true'; to the main config.php file at code root of the test instance.
You don't want real users getting errant info/email from your test system (if the test system could actually sneak something past mail servers spam checkers, etc.). Links would be to a system that is not in true internet DNS - has no SPF, DKIM, DMARC, nor SMTP relay records in DNS and they should not be able to get to that instance anyway!
So you can't test things related to email on the test environment - forums and forum discussions/postings, change password links, etc. And I wouldn't waist my time trying to get that to work, either!
You could test other more important things ... like getting the test instance under git versioning and learning how to update/upgrade core code with command line only git.
Or the installation of a plugin and how it functions.
'SoS', Ken