core: Environment#lock tests