add test for initEnvironment