Update test to use request->env() instead of modifying globals.