[test api] Implement `env_copy`